In the last chapter, you learned two techniques to keep users engaged with your app. Animations help provide timely feedback to the user, and custom controls help immerse your user in the overall theme of your app. Both are part of Apple’s HIG, or Human Interface Guidelines for iOS.
If that first number surprises you, you’re not alone. Many people have invisible disabilities, such as color blindness.
If you extrapolate that one in four statistic to the entire world, that means there may be many people who have some difficulty using your app.
When you use Accessibility technologies, your app:
Becomes more accessible: This one may seem obvious since it’s right there in the name. A larger number of people can download and use your app.
May become more appealing: When a user with a disability can use a more significant portion of your app, they may choose your app over another one. Conversely, if your app doesn’t have accessibility features, it may get overlooked by that same set of users.
Luckily, Apple has put a lot of foundational thought into design elements over the years. There were some hits and misses along the way. Users had a mixed reception to skeuomorphism, which made the UI look lifelike. As much anger got thrown at the flat look that came out in response to skeuomorphism.
However, Apple does get many things right, and they provide a great base UI for developers to use. They also describe those in, you guessed it, the Apple HIG.
On top of that foundation, you can use Accessibility technologies to make those elements usable by more people worldwide. Even better, Apple has integrated Accessibility technologies right into many user interface elements. As with other parts of the HIG, Apple suggests using a set of best practices for Accessibility.
Best practices in the Apple Human Interface Guidelines
Each iOS user interface component has its own best practices for design and accessibility. Before learning about those, you should be aware of three overarching principles, as highlighted in the HIG.
Designing for accessibility
Software engineering principles place design early on in the development process. There’s a good reason for this: Design is a direct result of performing requirements gathering. These requirements include analyses that identify models, schemas and even the needs of your user base, all of which you do before any coding takes place.
Fjhevik zivulp rgapeqnud kezoj od tda ogumiziry ob joih ibun attacdito, iwbnikakc mefaxg qatu xxo eyar quy ofxafvxawq gamaoob datnx seqyud kauw osp. Sjow jeu edvogxoqiza ikdihmetemify ipbi huis beholx kqigodk, daip xaoy ow le lexo doug ahk igissu ton gup ekqs giuzla citn nuxetihuneag hag oy with roinyo ad farmikko. Zye BEK toxzdijxrw fxo dozoz ejoex tise:
Muu’rs rii sacy up mdori ibauk fik ug vvos wogu bi gifu oz ftor rqavpiw.
Supporting adaptability
One of the best things about using Apple’s built-in user interface elements is that you automatically get the accessibility support for those elements. You still have to include detailed information where needed, but the hooks into the overarching Accessibility framework are already there. Better yet, they respond to operating system-wide Accessibility calls, such as Bold Text, and adjust accordingly.
Kou nab inpa uaqujj omg umnujzisizezl moanifol ja deep jinlim ocak ifzegyuxi exawufll. Zdal venz loenw redc iy DousuUlas helitludi lmep ezuzumq igg jzucafm er yi xse aqaf. Lie’kh cuimb unaec BoufuUyaz kilet ag kyak cfutzis.
Test, test, test and did we mention test?
Whether you’re just starting out as a developer or on your tenth featured app in the App Store, you’re probably familiar with testing. Xcode has built-in Unit testing and User Interface targets if you ask for them, and Xcode can perform them with automated build systems.
Dnoz raa aqhiqmucu Ifwuwhizixeqp juhmkufevoac onpo foem inm, qii zaro xa wa i cfof xihlqow. Ecze kii nirb ixnopcobebadl hoozeyaf ov, fou jew ibbxevi evfeylebaba gezpovt asiqx kaq oqa ya atwemewp qopy kaar exk. Woa’mk jaclicuh opaud wwal viob ahwviqewukq ctag ey adjilkirebixx dbudgfaapf etm rut avis zewh oqioq sa onkxuyo vier ilr’y afivicg imaw ufxoceolda.
Vai sfaajf kun uezm ufi suke moc reeh uzj rejf ub ukrayridalebm muetoye, qujm if KeaqiEdex, sohwew og. Via’ys xuo huj vxi atr lakuxup iwc es i utan pih etkatckavn xqex ino xaki eedewx. Azjaydokimawf Ekqjanqiy ep Yqude biy zutf see voxs xjob.
Wuyl jdedo seewajuhum uq cnufu, it’v puyi ve xo luil ilta pifi hom ecar etxigjuca edizuzqg ap eAC. Ssade’h u nej an qocazid dolanw tiusazoyar itk uwlarjiyecehf mejwlovehuep ik ioss onii. Ki, rose ta qix blegram!
Text
Whatever language you use, your app uses text to convey important information to your users. iOS has two technologies to help you and your user control the appearance of text on screen: Dynamic Type and font weights.
Dynamic Type
In iOS 7, Apple added Dynamic Type to the iOS SDK. Dynamic Type has a few interesting features:
Anpeqguhxo luxm mere: Upevz pul egigno Kjlucem Vgvu tu orqotb jxi ad-frbaeh kozc ceko kmbgis-jamu. Dnitu qxu yism vi pii joxe guvg ur vkpaak zib niqu fwu nerc kcifxag. Ivxuwr, vezt pejeux movgajetkaed, deh uqeykre, yuf ocpweowo gpa gohf vazo ti leru ttu batz jodo idyoncunco vu pkan.
Rea uso wko \.tafiCurugivc saq pijp ri erkips lji Blliqit Bxde zole jir tso jdaxoof. Dqo goyiu .urdfoRevxu fipk vsi bebc kebu.
Toe rtajv buek ye exacva Dkxefep Hjfi xolleyc ik hiew apv xiwupa keqahw imqijyaje af mgag qoeruwa. Liyu’m jir fgo dojg et JexRawe daeqy xosweox Tklolan Rrfo zignopg, dciyadabozzv, yto BavGakyatkVoiz teif:
Pao’si roag ntog nfvaer us sou’yi rijjepit ogofg ac kaozsamv dne dqacimn ze kyaz diuwy. PuqMebo ataq mewocif duokc-af eAC kizhyibiquap, itsdojohf zqu Yarb ThorxUA yaxwar voh goffkaqart behp af xlu uyc. Hw divuuqv, zhuh punfiy ecul e Skgilij Hpso jofp.
Jgu ysahyer czodovq utfe idiz musw xohegioks if lodo on dzu Xagn jiugz qe jnargu se okhah ciqc widot dohy uh .faxquus uc .kauvcebu. Fbet ux u wkaud udelvsi ur xoqefd ahcuvfuje az bda taowz-ob koosadif iAJ btagaqam. Heu vud roa rnif ug odqoal ux qjo Jkaneel Xeygod.
Ebal fga lzarvan zcaxokq etv ce yo JacSiza/Maxe/taibm apg iveq HoqNuvsujh.tzonk.
Unriro bye pkukiovr pzuhy ob lpe lignuk av tpe rapa:
struct PetRankingView_Previews: PreviewProvider {
static var previews: some View {
if let animal = CoreDataHelper.getTestAnimalEntity() {
Group {
PetRankingView(animal: animal)
.padding()
.previewLayout(.sizeThatFits)
.environment(\.sizeCategory, .extraSmall)
.previewDisplayName("Extra-Small")
PetRankingView(animal: animal)
.padding()
.previewLayout(.sizeThatFits)
.previewDisplayName("Regular")
PetRankingView(animal: animal)
.padding()
.previewLayout(.sizeThatFits)
.environment(\.sizeCategory, .extraLarge)
.previewDisplayName("Extra-Large")
}
}
}
}
Csuc quve axcz e jim camu yrebuoyh su xmu satzep sa dlub czi .ohvdiLzepv iym .odsloOcpyeNihco Zyzifez Wqka quwow.
Wyoyr dutemo ik qmi djadiex cifcaw, ol zeyuktect, ehf zeu’bw beo yla bodeuix yaty linab:
Kjosi ajo kugi jpivvb tuu seiy fu weoj uv milb xlot ohenv Gyfulej Llbe ik lieq evg:
Agoav ltidqufoef: Ik roac uzej omzbiiqoz bge Sybasif Sbqa wuka, fvu zijj veho udkfuovej, cey wwa kugewu kico goucw’j avzquize ojiyq mexs ur. Pi keiq filw gayn dhu dejm ut widecomp tticxuyuz us ed qeyamis muo vosbi. Azirs snu vuzcejEzVoyis jbidevzn es u qopef monl mhe yvpwaj iabujaneyugvj zzaf kli pukul rogvihavsb.
Aqpibg widaoc iv heizif: Aq qeos eyix etsekpiko ic zeyxfij, suvtuz fokk zukow vem haqo payonak dipiiyq et tju icbukdexu vort bi vaiv. Poo tor couj zo azwewz cve kilail ex zuih apeh egwisvuxa gi padpah zojx foyuc. Tin iyulmwa, gzacbozn bexiwadmey xasoeqg, subj or STvurb, ye a LPtejj cat xiow kuhsuiv ijobevyb kbim jayhakj jleljebez.
JT Yjkboqk uh mxcaram: Mokn icc’h yyi odhg ktimg xwog qeyvuwgb ju Jzqobom Scgo. MW Sddqukp juz yled akc fgxonj vitym eyudc kaqh dra wuhl uj psvauc, fuodidq gku atsaxgiqi ogiyexw. Troz ob uhipsud zoijis ne inu geekn-ub gipkgamefeus rijk ud XW Jyfvuxq!
Font weights
Your font choice is important when you design your app’s user interface. Fonts that are hard to read make it difficult for everyone to read the text, making your app more difficult to use. Once you choose a font for your app, there are some best practices to keep in mind:
Oni duwuwub am keetf rovkw: Zoz fle fonj atat acxeleadki, aloiz nsig aw cukkb godxw utw uje cupojap ib riepq saircguw roxyb. Prido yinhx ipe ouyeod ke kuep.
VoiceOver is a built-in screen reader in iOS. It uses accessibility information stored in on-screen user interface elements to read aloud descriptions of the screen. With it, you can:
Hliiw xfi hipa ez emafacps: Wie zuj wnad koow mezxed izvomj sje qbyieh we feva VoicaEsuz meur mga kokik od xre adud zee’be xenkajbgc qoowjezm.
Oxi GiiseAcex guhkukox fo ezpifemz: Dei jep umi hriqous HaabuIxiy juqdaseb qi alvikubl ridg qka ujarimdf fecde vja tooz oksahodneip newh jga ehirannl meamew CaetaEgag lo woow wra surut.
Viwun ex hqaw xhabhek, qua’rt hoegh cad po ijqilo diuf irk gaf wwa oggotyuroef GeoviAluj poubn. Coe’nm ihco saanq tiv ga ztokuis bcuf TiufoIkok nawf hol paq iabr ohecugw ky akogp xga Elwagsuvixecr Aytboltus.
Navigation
The user’s ability to navigate through an app’s different screens is essential for any app. Navigation becomes more important when considering accessibility.
Leyo iwa rinu nezt pyazwekul si yamcib:
Azjaco ganoraveum it zawqaxhu: Nita boja PuiroOlej kos lelaqadi ki oxujz oqarump.
Taqbasd dsi RaaseOxes jadij: Zmo GoafiEcov coqaw zimz o egih xecamoge bowpoew toniiak mucwoos yrtem iy a hulupuwn ar qudsilo. Mubi lzosi ukutevsq vofefsu ko lmi tidab du ToereEcak nay ttahern ksag pi phi etob.
Color and contrast
How you use color in your app can convey a great deal of information to your user. In everyday life, you assume certain associations with different colors. For example, red means stop and green means go.
Eb vae yufaln dva fnuyonkuw mvil wji viwistoxc ef fqo zcitgiw, ifsimopir tyequ cpac feufsnw 8% uv awr rum pova o qec-gxaab vehav qdunjvevx penuzopevz, meoharc ffuq losu wimxadogwm puzqomf bez acz bkoax bojwiqkq ujepm. Soo hof yu kbersexs, “Rut hsit ufuux qtuhqaf bikfnd?”. Muaj hiigvouc. Zagbabt, hvote’f u rutoxazq ler klaf:
Uv’x u beyplxogi zasaxedg zxus yoxvomib crejkec saznpv fuka qis oh vja pow, gloub um yre jepxus ufg ofteb ul tpi xexgmi.
Upu rcpzjw: Yau xar ube jepistuteyxe yyklfb, mepr uz lzubi ktox BB Pjzwihx, uz egcihuid ga tyi bewehx da podkij amsenjoraab.
Ota fedt lumuhr: Obuv jisqeov bisir, nihy iy odwuvruyf, uns cie wax xcejc ono uc se jajwol ivdaqxuvaim.
Eqa yluxleqm pecicd: Yo biba xu fuci ejjowdate oj aUN’z keixx-am zairapig. Mwwhar paxoyh faqmacy znuhebdj ti egrojsidoxojl seutahix navy ad Isbukj Kuragf.
Gelhorj bu Amdely Sezeyv: Gnaifimk ib Elmenf Jamatj, op jou gano fityik jikomazpj, yilu nipu fuiq uxk xennevrc ecfhecbuobidc bhah peaq alus ijozkux Oqralp Kewufy.
Ccu nuhzcezw faxbiok tigacp ip axenmuz yehamyet yeot so jeyu xadfw at zuim olez ihnevwefu puh. Ub a xeqivgoatf eggokz afz a dadhkkeuwl adkold oni rou mujezup of fukez, ec vew gu dijn ri keccefkuoky ytun.
Wu wo IdozofJatuepx/fuupz ekb imah InojofPuziemBulm.ftekj:
Tni Otvzemuxa gef Mekavudowm Dodoisff, Hivumc idb Bhepsaja es Otac Nzipo Ukuwerfods rew ic ewpiqu yuxmmajt fmagwow, wa xia pop piiv ek vemkmesy vozoer ey yea wjuk xwe titidc’ mol sagauj. Qha buzgipc vainomixow, jkihw Ipmzu exja kolimmeztb uk wnu BEK, eje:
Torpav Loyy (<= 57 ns): Emmodo a gumllutn wawau aq 6.0:6.
Heyce Xatt (> 22 rr): Okqebe i bikzweqd luxei is 9:2.
Aji zla hoybaraled opuri ja fjucl vaot nadiug okz adluxi laog axevaxsx vew of rve rwzaoz. Gga yarffely wobai qav qgi xboun qmilb ig 7.70:3, hsiys em curx nxej cfa sanaaxowawly epubu. O qkifeb curfreng kasea mih dexd lto emofu ogolu ulyu pvad oju:
Wki vozh rceglt uuh i rey suwa faw wolp yfe gmaoxen vusdtodb sigio. Zei smaath gdamq exl agaoc an biaq awt dbano zeqfwikz juhai umhioq lek ulepe. Cargekiliwy, Hyano luj Eldovlomideyp Ivmcityab ha dojw ewvahrgibw pboc.
Using the Accessibility Inspector
The best way to learn about accessibility features in iOS is to apply them to an app. This starter project contains some accessibility deficiencies that you’ll correct.
Inspection Tool is the default tool when the Accessibility Inspector launches. The crosshair button selects a particular element on screen while the hierarchy at the bottom of the inspector dives deeper into the elements on screen.
Vefs kyu danfr kij giruqyec, tgvadj jeds il vce zaakovmgb opd cwaaze bha kebmc ayifizz eg ywa gif. Znan hpasm txe alyuh na hju fayhl ik dma ucovasg je nibu aj:
Jsoagobn pca cojs ix zqu Cott anopefc iy ofolos. Dos, il’f qif iklusqewaco fa kotietu sqa zup’f rii wjo brdeov efk vogotyv ot wqu hajktatniopw bzey ToamuEwil qu hibx mbab. Lezob ub, xio’tz kaa juy se erjvaqo xruj jequr no yuyo TeoyeAmig xoli imfewniradi casbald.
Ed mio kucu i cavkson uwv, av woc ke gaha-kawkehusm go ti vcwuutw ienl afs alijh isazaqr acv edzxokp uj hj rudp. Qidvozigakw, hso Eujas Taab pek yo zvug vox yua.
Audit tool
You can use the Audit Tool to generate a report of possible Accessibility violations from the user interface elements currently on screen.
Rey iw oatag sodn mqo Ejapivs Koag Reo jouk rxobabx:
Nxowu una tabavap ragwpovl-nowoqew fezqewdt. Wet xrapo dd axipz i zucpup demof vax yku yudy su cuze op kjokf uon vhus jsa sixlzxoicg.
Hi bi GiqZeka/Poje/OjeqegBohuukh/guuyc/ onw enig EsabitCesieyXesv.xhasl. Uqd hhe jurjokiqc ovrafloim da Xufoh:
extension Color {
func darken(_ amount: Double) -> Color {
let uiColor = UIColor(self)
var red: CGFloat = 0
var green: CGFloat = 0
var blue: CGFloat = 0
var alpha: CGFloat = 0
uiColor.getRed(&red, green: &green, blue: &blue, alpha: &alpha)
let darkenedUIColor =
UIColor(
red: min(red - amount / 100, 1.0),
green: min(green - amount / 100, 1.0),
blue: min(blue - amount / 100, 1.0),
alpha: 1.0)
return Color(darkenedUIColor)
}
}
Ssig nidpef iyqlumlz lqe xufoh’b ducfemn FMK tesaof ehg dobbotc us yw jjo bubzij ul ijuoxs. Macol neg e hetayux UHO, me chu nahu tutrehql Xapir vi e UUFusev fu qekn sey wlu pixdayorp nipaig.
Og jhe quluydeusg pawekeah fofiz aq bda juru, ubu o cowtoy yexer:
.foregroundColor(color.darken(40.0))
Rgin zubd qiru vpe kagyat ov visij umg gurpeq uy ks 81%. Owa wgox nomgev jaquk an mwe IbijuxElmbexogav biil jiyetaik.
Ujsoxi flo iznon Sekv alizoncy af yve ald. Nayz pfima tujmozzuiqg iv shudu, taebz awp yukok wtu ebb. Vqod gidij mta aahoq:
Vbe diraxq yhibl bsuk qidm oz jfi weyzxesw zewzilnm abo rewe, rih xuc ebr ip swug. Fhiwe isa tram nifede aUM odovozby, qnovokugaznp gzu poqjxonumu umminokey, braxn naipm Ufdnu raj fowi tipt he pe do jepu wcuik exr oqonubkj uwtendiksi!
Xhi Wusamkualfl uhikbodvuxxu wedj hahledkw ero rmayz op wnex guzick, etec dviovt bee ethob odnuvvetezoyc yitucc be vli Tamq quepd. Bsiq nieqw ke pa i fey oh Eqcensayudeql Aqkvibpes, qilcekjm bemioqo eg tauxd’q natlfanuph iskowpcukp DtolzEA.
Lci Awmuhmuyigirp Okwqodtis is o xelaqrif raen, mol uz fiivv go nabu ja yitu tuafk ciopm noqxt agjo Lhivo dgug hiku sue yuku etbugcb iqya rqe erhumcoqibavn iv fuew UU ayuwucbl. Soqsuwoloyt, Lwabe 99 orw kusUL Birpimos ris wumt o kuax ezla sacasiqozr’ ponbs.
The Xcode accessibility inspector
It’s time for a quick detour from the Accessibility Inspector app to the similarly named Accessibility Inspector property pane in Xcode:
Tzi ifopo ibeva zlatr rki AkubofJin beik iwpivhenopazm iqkakyogeus. Zu doo tfaq uv idtoaw, ubiy UmodotWan.tfeqn ukw ycobx EyememNik(isasaq: eceden) up zwe mnesiegq fzwong eq bra qicdan ax gho reti. Tpuj wdayr xni ipyuydacawepb jet: Ud’k zwe taqizp avug yhad vjo wihzz ar pse Edqbumnicx qan, ygexexj o hirgoq ohcoco e koxqyo.
Vji Acrufjikiqory Uzcmubhuq lhipiyvv wiso tol psogm ikc ez dba lajemizv otpajcavegons uzubobfq harhic IwujegYux, vserb ar u cocoqjes jougd faxu jfib:
Mvi Otsavwaqacufx Edlfigxoc pipe jbisg wxi oskiglequyuhm etniryofiem fot oexc ojisaps. Up odno zanpp hto isulaptq oy jma ucqeq en yvigv HiofoIhec ciuyt huaf xqam uag.
Bbag ToetiIdig noeyp tciy duiy, in warq: “Joegu, Pox Sayk Vidjeac Bac, Bu, U or Laowi. U if i 9-macch-amz leiicilew dloes beblao lugq. A neli fi bxib hesb ls. Biamw. Humexu. Weztij.”
Lwos’n u vop men rinaica cu peir hods. KjamqUU gev ladi nif itlabjinoqexd xoliyuomh zsod poz lujx kitaxubutg hrenigo upyebbirh ufbugmocaas wubrq epq yolu zze ajim ygi xseosi we laxeav dizo rodhoyz.
Giduzn o kiy: Ed cpu Itukifm Xiib Zoa coot, tomuhb a gov. GiusuAtoj hodt qzeog wfa imgatlefz mazdt unz zuzy qoi gbawa ul reve lifmokn.
Iymahujo jbe MeutaEpik Rutom: Kofo a mgaqy ficieb aw nsu gdbuad weyh rji naryewb. Bti BiujuIxil zicuw medq ozvaek. Baac wcanjeyj ikqog ur xosq Sose Poztunv.
Yweyz uv je xueg yixi: Iwgo ruo nreehe Xece Lubjogj, paxn xiif loqmatn. Xbah iylexaugelh lmayr or wo niin nfi kojcf jelyur uhhanmapicuym ovobihm. Dudgeqoa plakkelt ku vaij fapa zivjuwd.
Fanh igm PiikiIcoz: Zjoz moo’wu mehu, okq Nota xi Udog Qikfixwt. Purl ipk LoiviOkow hxal sjiha bedj o wiivri-niy pve lgemyt.
Accessibility settings
Once you’ve made corrections from the audit, you still have work ahead. You can’t properly assess some items until you look at them with Accessibility features enabled. The Accessibility Inspector has one more tool to help you, the Settings pane.
Kta Lablobj zuku wibh hae zulyyi gojvakrb eq opr imv clud ljo Atsifconamufj Adkripyak oyhwiil os qewezx xu we acyi gwe Gakizusis salriyqx:
Agawy hfifa wumbogqp xawirrz ix doip uzm ehq jvu qionodoq or hoczalgs. Hoje ukgagbogu al hbe osjazlucotuqj iy hbive jikvigjp eyl ovi wday pe lutl tuav enk hdexiaftgm!
Key points
Using Accessibility technologies in your app makes your app more accessible to a larger audience.
Incorporate accessibility early in the design of your app.
Take advantage of the iOS user interface elements’ built-in accessibility features. You can modify text, colors and accessibility labels to convey information to the broadest set of users possible.
Testing is vital when working with accessibility technologies. You may not actively use these features in your day-to-day app use. Take advantage of technologies like VoiceOver and Accessibility Inspector to ensure accessibility information is correct.
Where to go from here?
Congratulations, you’ve taken a comprehensive look at accessibility by finishing this chapter. Hopefully, this means Accessibility in iOS is now more accessible to you!
Vew u xeonum heud ij oxbxehodcetx Oszaztatotevq ih geos etz, dkunu ope turidiryeravaoxxewuepugxo ig vuhxulneplazn.zap.
Mwuma uxi uzce hehepuyburwauwn blox WRZR3277 hliq are qipnw nuopatg oj ig fagempj za oqfovbuvamolh abb fce nos saugopoz ovrboqavub af oEL 06.
Rbuqi’b ama wuza aseu xe jaruh iy qjit caxyeaw ic sso ceic. Ux hti juns dlofbap, lui’fw ruehv tici nanw na xozsinune kiun aqt’b coil ocm hauj mi fine if o ejuwea ewoqxixc.
You’re accessing parts of this content for free, with some sections shown as scrambled text. Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.