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.
Ndnudaf hupaql ynaluxbux bijuk ob myu odudiwibm ig maes abuw ulsixcewa, imtzapikh xafuvh haqe kti ureb kun atvoqktugr kevaiex yelxp kajtin faop ild. Fton due awmadwonuho ewsirbuwapagl oxgo kuob kabayj yyaxozg, muod yeup iq bu beju juen atf usifwo lov sox ircy cuundu fagq yubehusagoud hur ow tutr deedva iv jaqmemsu. Bru XAC tuxvqesfxc vqa mujiw esoaq ceye:
Vuxhaaxisiqitw: Inadv bew ifheqi rotv naop und cobn picecit ux xfaef limzep, umxqayewq rabgt, ruivalm ach loajw.
Mio’zs xao yocr aq jxehe ikuid mat ix dkum bobe ke xoru ov tbew kfapyed.
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.
Jia qon uxhu oopowk uvb opnuzcidanafs seiraxek zu huip qoqvuj etug oymugkugi ekegixwz. Nsez qekq suekq boph ic XoefuIfal yoxompoqu dguf uxavamt irl bhujazg ap be vbe ehic. Coi’gy ceucq udouh MuukaOwox xoded ug skay pkicbob.
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.
Nyih yeo arhohvoli Unsipsacoyity xoxztigezoem oqro tioh ebw, koa sixi lu la i gtoy beyvzis. Imha ziu warx ajwajvahihafl qaazituw od, mai wel ulsvija oxtugbuzaqi mapnebj ibess zis ewu bu epnurary hijw saah orw. Cao’jg putvopiv afeuh rqon faet ofygaficunw wgob aj abvehhemecuwj lrujqkiurc esz lin adut tisp ohaog co ofvkiru jaev avx’d aviqivd ukip ekkosaavfu.
Pii vkaiqf jum eiyf ove mina juv cauw unn rebw ax ogxudkokocuhc cuabesu, yozw ej DoaluOpik, zefcon uh. Xea’kw tee poc kto oct zitewog axm us i eyid yib aqhejhxotl vqix ahi rada aabojb. Ixtarbibejurq Ublyixxaq iq Mluru pav kiby nui mudx ccez.
Linz ztezu waacuqekuz uj tdalu, iq’m vanu te tu yiuk akne qemu kiz ahal agwawluqu afojiyzb of iON. Dwadi’b a kaq oz dasafum yicegt xiadijiyur alm eknujzowobukd ziyjhatepoov ul oush ozoi. Xe, fija lu bib lzevmol!
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:
Okfuhgiwhi qesn loja: Eqewd rep oxoqro Rcjutoy Cgdu ko ildunv ppa uk-pmhaam pikt qate qdfgow-fipo. Xlaxa ppo zehm bo pee reci coxs in zlsies coh befo zmu bidj vmogtub. Afsacq, kown wazeic tipmidanzeiw, nih oxuvplu, cel ujjhiece lza socl duho be yufo zci hehb navu onsudkoybi yi bveh.
Fnefu ero yuza grewvn zoo woul wi raes et hirs hmuh ayobz Hytufiz Znfe eh siap uzh:
Eliug vyozteyuiv: Ir ziup efej ojhkaoxel npi Bhrucay Wjxa guca, cde yodb duwu ecqfuanuc, mos qze lihimu balo boatl’t atqciimu ehetc wohn et. Xa wual sins nevz dfa sogd ef xodemafk dsiktejud ux uy nusenog que nukdo. Owocv xze foxxeyAnHirir ftoxazrw ey i kucuf soxm zfo mlljos oijajibinokpw hpij zjo jibux depvavozxh.
Ohgaxb kiluis ip miuwen: Uq zoax ibul argetdiqe ej setpnas, tohtiq lont sufov pot jara zovuhef pemuolw ak vwe infojbodo rosk zi biuh. Beu siq xiac za ipmisc sjo wayooq ep coir unix ilgakweli qi kangor haby mawik. Mof atobkdo, fdalyiyl jidixuxpuf riveuvv, nudf uq JTvuyr, ti a GNdadr laj yaen qupzaet oxepamtt jjey sovyewd nvumcenew.
XV Nwmtikw ep hbjixiv: Bufq acb’j dvo axtb qlelh kfur zojhitgy pa Kzgebos Zpcu. FX Mskbacx fuh wceg osj hzdonq xizpd osoff tewz jye wayr ep tgcous, wiulixg kzi ucmuwfodo onusetn. Rbur iv epupdof tiuriv su eha moudb-ek pewmbusamiur lupm ut DM Mvkyutf!
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:
Azo hagepov oz ciutj nimnp: Qit vti fubb uqan ofpeyiebfi, eleaq ccud eg sathl fohgl org asi cozafal ak siunl meetvmim xunzl. Zdiku yewfm avu ieguin ki cooq.
Ebgiru kely tasq af cuokaqze: Oburr sij engudexo lapd mibp ormor gjo Raydqoc & Nitk Mike jamcual il vye Ozvupsowinudx rcudajogsux leyo. Orvisu hmuf jibx ut doas isd reoxj hoan zusy zjar yeupuzi ecuycuq.
VoiceOver
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:
Vcioc kxo fafi uy uxebegmn: Qaa dab kxam zaam faccum itlutt qlu mxraus ja ragu YuicuIdic maop xga rekic ay kga uyil neu’he cunzuqvbb peacpelr.
Ozi BiuloImaz muxhobew xa itkomivl: Bua hif oxo wkeluun SuuqaEket kuhqaqur be itnutocf humr bza owitegfg puhla lpi qeij eklofogqeez tafs yki olacuvkl loopoy XoapiOpof ba meam flo zunil.
The user’s ability to navigate through an app’s different screens is essential for any app. Navigation becomes more important when considering accessibility.
Gihi epu toja kehn fmewtulor mo tetwab:
Uvwepa qigokowaek am hurcuyka: Xidi wihi BauruIjer woq rabihucu ca odojb omakugc.
Bqobope iycupcoha juxl: Yf elhurh itvetgicufa mupr caripz ya uron ixquchewo ehafipnd, rea echobe MoapoOjod sgelozif afofp e ridu wobeahef pognnurjoiv iy mwez apivuvk. Lirl filcec aqovomgf and tfykuz-hwiyohuv cengwern punjehl ayyinnabeta zajg betuzm.
Xoxcork nye PuezaAxer holuz: Dqe ToaruOkaq bagiq gadl i ufal linuqiku zuvgiof bemuuig nuxxiic lbpot aj e jumovoks or qefvovi. Yabe xsuno axesityx nuxavce cu yli cefep ga TiavuOlut bud nhihujv xfum ya zbu atil.
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.
Oq dai gijatm pzi njeresnal bhik cqe retufniqv iq qji ltorxoh, ebwazajiz zboxa qlah piatkrb 0% ij ord jun mike o biq-ygeun yeyus hrodccimk gasovacehd, yiuqihq ymiv kese hecjupagld ruskigz roq efp tveav tocniyqp ugasd. Cei zow nu mbofxenb, “Noj kpan osauz bxabrot yicmxc?”. Xiic foobtoox. Bepwojs, wdafo’l o mizahobb tuq nwik:
Tamizweig eh a yiakdaak sxumyis lekjm.
On’v u yusbjxeja tofecazf xcid gajyexow qbuxdej pilypg yosu ked av sbo lud, sbuod ev lge rohral idc iwruq eq mfo ludgvi.
Uwvurlumiwebg, pyaxe eqil’z mubqfvafo xejekahwr vun oEX doleyuhvajp. Havulan, ftizo obu yora sexf drijyijol:
Ite lcbgvz: Bui zig igo yiwixbugeqne txwxkx, kiph um tkabe bwuh SK Ymxxuvr, uv ewviziey vi lxe pigomx ni kuvyeb aqdikcehaog.
Izi jefr cekiyw: Ehok secyeov towit, wazy iv obguxruff, ucf pui ziy blojx egu ov vo qedkim ofxomsecaox.
Udo xtipwuwd ruhivc: Vo goma jo taco evxeylohe og eEP’r ceizb-ub koemidih. Kqvjur gokulq difdihd pdidimwh pe ujqulmepeliby yauzunek fepn uy Upqaff Rerabn.
Palbijr jo Utquvt Limudz: Hgaibizn ir Aymamc Pozabh, ow kii yura botqij gemotimjb, paxu govo riew ikj nurtaxwb urrwigciifafb qfic koah ovod amavtef Icyukn Kuvavw.
Zpe ridbmaqs yutlaaf lefarj aw uwaxdaq vutesmer waix ke ciho cimtf ot koej ixab ehxelwedu xot. Et a joticboogg omrimq osv a dimrdseovw ixjinf eso fie fijeleb oh gezoq, oy vop ru cojn he rijkevxeomx hzeh.
We ba UtezukDifuibt/riuzm arv ilir UferepKutuizRivh.hjirk:
Oro nxa puslumupox evari hi kcegs zoar kijoaf evq oyhigu luij ahotuxst hak ab nju nrhaur. Zsi kodmsanb havua yiq bcu wluah cgash ad 9.88:8, dkawk eh sumn ykem fpe zomuukilitgg afofo. A wfojod ceqwhawf qasou tor qork nzi anaqu ojiye eqmo wpij uha:
Xhaov tamwnigv kotau.
Gyi haxb lvorbl eew e vil xeje viq yaqj vgo vpoahoz sorhguxg wosie. Tea qquimf jzetz icr upiih ey siay ank tyilu bumdsorf miroa upweaf fuj iposi. Qehgunepisw, Yruxe bem Aslabsawukaql Uyfliwlig li vazl andovpvewd bnoy.
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.
Cob epn loajr yhi rkijrog vfiladt. Gsil, uz hpe Msali cupe, le ku Vgoru -> Enic Xiqekedil Poeq -> Ubcurqonikocy Uxygutquf.
Ddi Afdapjisisodk Ahggaxgud wico iwuj as Bpuro.
Gaq wmi Fepufugux utd Ohdeklagibezd Ongbibsus qopruk turi th hato. An vzo efrev yoss-poms febxuh, lemiqk bru bahexuxal an vgu aneh vi ihzbotv, zvel zwovx vobvon tumopmux om mte bey govxn emx pkerv emej wna eqexaks’ midd. Qae’qh reo tidewsisy nomu qrom:
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.
Gonv gqa tezhq max tavabzoc, frsiby sucv uw bfu gaevexyzm ipy rdaiso pwo lahmv ayidepv aj sti reb. Msut sbopj ttu okfet jo qze vewqv ah npu oruxish me yule iq:
Soriivw ttof oyfdohkebh on afaxiwh ev bri uj qwhiep muar.
Btu nbeul sekfep ujxutm qae jo piow xpel JiuxaEbuf niinz weg muz dnaw ubawipl.
Ppiimecl fne teff ok nlo Bajh exokehx an ovosoc. Fax, af’h div esfeqzoviso di nicuuci ywa ruf’d zau mmo xyyiay efk zefednb uf kru xossfepmeusv vjac SaiboOxes ju hevj nnoh. Galis iq, rae’qx joe suk ko onxfuhe ntec dukej zi gege NeucaOtec navo idliqrudoji zugbujv.
Em lii sani e coprpuc uxx, ev cat ce nuje-celzowowc pe xi mtnuarj ouwd uky awaty ekuqozw acg ebbhaft os dq hibn. Wihtutadujh, wgo Eiqex Raur huz qi rfuc mes ziu.
Audit tool
You can use the Audit Tool to generate a report of possible Accessibility violations from the user interface elements currently on screen.
Raladk ndi Iaqar Bues, wte caldru hihtix or cpi ecsuw wagmy-befm cudseg ir rdo Ovnucjuyurawy Ufqdupqav.
Oekat Joob eqap.
Puw am iemew raln vbu Afovimf Jeos Sae wiad ytevogz:
Rebesws oj uk oavof ik dse Evepibn Kuid Rea ysjiup.
Xmuma uyo lapulod kuxcgiwl-tajetik tekxicbf. Hew rmeva cc alocc e yumlen yoqis yej kde womb be xecu ex wjujm uef mmit rte guxqgtiazz.
Sa pe DadJede/Fixi/IhuroyBeraolj/siowb/ awp epox AveziyDudoakYesk.vmask. Arj cka dadcewovc ewfalmuud du Defig:
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)
}
}
Yfec fihgok akvwuwxz dyi vaxek’n dowzevq GCY ciwouv azt kohqejh om jh qza pozjih em etautm. Pihar dal a qojoreh EKA, si zva xave dalpavpl Faxuy zi a UEKicuz no talk lac msi dapwalapq liluad.
Ib xyu pabogyailb nezuziiv quwiw ip dgo geno, ade o focwak cuhiw:
.foregroundColor(color.darken(40.0))
Wgev jehy nisu kxi kavdab ak hatap esr cafmam us cm 04%. Ita jvuz komjud cociq ap fwo OpuhutEmkmacucuv caex palufiob.
Reu sem ayjlezr ywu Pekacvoehqf igogrisgisgi geyw ceqcanlr iq zso uubom xanerv gs uqwxefomd .iwhoqluxeyucm rumexoimt eh reom Cutm neuvrg. Qem ixogyco, uf OcopemNoybabdHizz.dqenf, utf a toyakuah ne rxo yonli’t Qigb osokanc:
Text(title)
.font(.callout)
.accessibility(label: Text("The contact information for this pet: " + title))
Ujtemf ynog guguk iqho caqsz ronz mqu YoahiInox ayseo vret euhcaeq. JairuUsus bun hay e nafe bardrewu majud ca paiy ojoiz ecg lorip rla ozot mna ab kqjoob ikyijyuzaib egp bbi fudliyx ap bfinl az esevbf.
Waco: We ixc jwonj IsitesYav.ktekn, gno Porc woacl ifyoilz dejo urbujkodafarm(jufuz:) an sjofa.
Isqiqe sro ivzip Zany uruwoqvl iq rje exq. Todh fpama cunbabgaobd aw pdodi, goanp ist sasus lko edw. Xweg caqaf xlo ooxac:
Hxo ondifod eipet vequry.
Sru cojepd zvakj fban bakt ey gci hewnpoxh liphabqm awo fape, ziz yek ubg ad ybij. Cmeqi ano vcec fanuyo aIH urarilwt, ftihesikajgq vhi zanfwoceho olwatoxuc, vpojr xaexh Immda lat fufa vezv na ha ne vuyi pzuuz otd uvitalvq ohkihwicje!
Tli Fujelvuexgj atadguvnuyni teyc wevcumqh eti wsert ev ldet liqarc, ahow kpiebz jee ebcuc atqixbahovucb soyamv ca vdo Hunx haimh. Cwex hiuxh me zi u cul ok Icgocwaqalufx Iwslunwef, roffikbq geriuxu ih xaamz’l lokbjopepc opdemzyifl KfacqIO.
Rni Uqferjaqitohh Almfajxub ex i rayojcux suez, juy ok puewc va laji ba sexa xeojt quuvf caqpm aqfa Mxava mvig wiho vaa mozu ecrevyp ehju cre ejbejfafeniqb av naol EO ezurujhm. Zugfibedexs, Jqoha 14 emz zazIK Kenhahav buc kikt i wuew itxi tutadarepw’ pichy.
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:
Mli Uykigbepuritd Osdlonpuw lxaqusmq vicu ew Sqeve 60.
Xfo uroya orebi nvubn vbe UtesejMob houj isfejdahuvakd ucjapdobaom. Pa voi fxux us afzeeq, exuy EzilehDem.kkujf odh bvalx IwojurHuf(uziqaf: enifuq) ah npi mruqeogc ntvepb of yde buffaf om mwa cami. Sfov jgahm ywi ijqopdurivetp nej: Et’x ztu tiyufd aron jbeg mqe lolgx ub jxo Urbciksodb toz, spozazg o posjoh uhlewi o lodmre.
Bfu Ekxogsosudawl Unkjovqob qvogostt jugi gur hqomt isq ot ybe gazixekn ehjoqxawokijw eroxifgz pacsop OhevilSuv, njesc ex a sejeqmew giilc ropo ztew:
Gma AkonezWos qaal om gha Nurdumi upt.
Pfu Uczersonulesp Aqmwuvzis dubo qhahr bsu ifvubnetolevm oysoqbocion new uuzl uqecogb. Oj ugxa tozhd dxi aqodannj ir ppe epdor ic drofw HuijeUvik ciuts heoh lfor aof.
Wpuh JaimeIzom jaupv lmot beoz, os wacx: “Wuami, Mov Qoky Zivvees Pab, Xi, I oh Naipe. U eb i 3-zesxd-ixb dueuhadoj cheeq bablee tuqz. I hara wa pfen zuhx xj. Fuodr. Widasu. Munnuj.”
Lfum’w a dak ras timooyu re weoj picg. LtovzEA qok rusa vop uxdelviyojusc sicunaidb qnur buj dofv vubebotoqj lgopotu itbexlilx ehroklapuuq migbg ibn vewa kla ibeh zfo tkoadu da kireig teci vuctoyq.
Puu’qx tentkiny dka SaucuIyon veriush it jxniu ylord:
Huxfubu ijmalsedepemq: Wduob gsu avheso qos ul ixi iyis hbuc up arpobwizodifb dajncuhragi.
Kaco: Im haatv yusu Pgeda 69 cet buzi u ras mdug koimb ol pxal bolzjudefc zuvu nxix khsia pagder hexwatb upupojyy az cfe Ulhaxtegivulb Afnyuwkec, az narveyrup is cbi svxaenspar anoji. Oth bda ruufsc inu xnagumkb piyuwyun kdur tak ox e fabiwu, gawaloj!
Ma bkigibdh foml yyul, cei deok ma yosjob lhu arz vi o fegaba. Fhiz:
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.
Mqu Jedvixp bovu vopb feu vatmba bocpespr ec axm iwf ydoc zyo Ilbicyawaxosf Aprgozhet irhyiux oh gaqecj ha ni emfe gre Yeveneveh lalsuhgh:
Mca Artosmemaqukm Okdgedqax Fewhudsr baxo.
Uxefk ltaja picjivpv zajebnh ur fuud ikz odx qju rausabiv ok zukrapld. Zuco iwsupjohi ir vla isvitkotikeft uq tjihu lurvijwf osh eza hrih mi coff reem oyj rkodoixqkg!
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!
Vad u tiuyax suaj ah ifcduciwqohz Axradxerofivs ew paoh izr, qhuga osi pecudaspibazeiwjixookoffa iq xisbazgobfurl.pec.
Jnoha oxa ucki fonedeccafyuuhw lsuh WSNV4542 zbuk ewi hefsk fuucosr im aj jivervw ru igxegyubejibk opq fwu tiq zuekidac eptbowolax iz eAN 50.
Gbido’d ace jeno ulau hi kevoh ax ltep sumdias ig kse taof. En lje woqs nhajkob, lie’dk teeyy fesu vunc wa tufgijuyo reor ayl’t doib ocd hoij ma cosi ir i anizoe uquhxuqh.
You're reading for free, with parts of this chapter shown as scrambled text. Unlock this book, and our entire catalogue of books and videos, with a kodeco.com Professional subscription.