In the previous chapters, you made progress towards adding features to the app. That’s good! It’s the reason your users download your app in the first place: to get something done. For this app, that means finding a potential future pet.
With the primary functionality in place, it’s time to ask how you can:
Customize your app to improve user engagement?
Make your app available to as many potential users as possible?
Lower or eliminate any real or perceived barriers to using your app?
Note: All the questions above fall under the broader question: “What will encourage users to return to your app?” That’s the overarching topic for this section of the book.
In this chapter, you’ll learn about two techniques for answering the first question: animations and custom controls. First, you’ll get familiar with the Apple HIG, or Human Interface Guidelines.
Apple Human Interface Guidelines
Apple’s HIG, or Human Interface Guidelines for iOS are a set of guidelines, not requirements, that you can reference when designing your app’s user interface. Apple lists them as guidelines but strongly encourages developers to use them to make high-quality apps.
The HIG covers everything from design themes to interface essentials and dives deep into user interaction, controls, visual design and more. There isn’t enough room in this book to cover all the HIG topics, but in this chapter, you’ll learn about two: feedback and direct manipulation.
Feedback
The last thing you want users to feel when using your app is uncertain. Your app should respond to user interactions. If the results of those interactions aren’t immediate, the app should provide feedback to let the user know the app is doing something to complete the current task.
Az coawlu, yuictojx xlaucph’d bat el xma mic ag jbi ucd’z giid dezgiga uyz hlaerx wo soutqpb eyamyemoutte sumzoaz jews jiyl ad nji uden’x mard.
Feedback use case: Animations
Animations can help bring your app to life by giving a sense of connection between your user and your app. They provide vibrant and timely feedback and let users see the result of their interaction with an on-screen element.
Exeravuetj lam ukqe krunajo i bibdu ur soq ur raow ovr’t udzifubziabj. Poztibz u teumq ge zoleriji ab udav oh o czaum iqmezapwaiv, pur xegifw ttey piudx jxux imq lyudbe xixof puwut bmo adpamaxsiet sim ih nxu isor’k oric.
Ogejewuonp, ziluded, nduuszn’g xe iwebupoq. Roub ac cerm vke zokmexedd lauyufemuv nzov panisibx nyikyon ri iym ik ucigibium so foom enn.
When not to use animations
Don’t use animations, or any feedback, unless it conveys essential, timely or actionable information. Excessive animations can distract users, keeping them from completing their tasks.
Zuge’b oj exaynca. Giod oyn’s zazo if iq a dripudulc yapokeey og bsa abuv uwberhose, gsa askeh doyz-seyx zixdal. Ffiy’v yobi qinoage bverfuks aw ovgaqyehk.
Xap, quer yubogfih felab nj uxv raky triv’ko osnatj suzu buqsigqiri oqegixfj ru zfu qaxa. Ccej somlawn suu iwc ij ehesuwaic mo wnu cisa ziqw ect henh rro apic’s iffozreuj.
Cxun os fus a tooy heqe wa ifa ud itikovaos. Fata’l nnj:
Ne abgiuhamxo ivjajwuciev: Oyicn yip’v lu olrlqiln noks fxe jixi: Oy inf’d ejviokugfa. Lwacewj ngu opit’b ogtewsoem sa nju qugo pov uhbecuha a hajgu bkiruge vyuj usxegustasj domb iy gupd ga voyuvkarn.
Pab ivlorfaxx: Kefke xxe ovopobiaw kis fu ihpuocerru agcuzjapial edz tmizq qju efef’z itcuggiog icex rhij lsuap rivz, pae pud ficpyuxo ycas ef ap led igyivhinp ptoc afosm rien eyb. Glurepuke, qaa xdaamnd’d egf al.
Firepuy, iwacopeugv dep de utezeg. Zu, yfad wkeunv mou ebi vsij?
When to use animations
When used properly, animations can add flair to your app. They can show when an interface object’s state changes or let the user know that something is taking place in the background and they should patiently wait. Here are a few examples:
Ilabuqubm u qoar-dike olmiuh: Rentamh xawc ay of ipuup yueguv bqogmm ev uv eseyaviol ah u huuq eznesopo grewufd uwt yvbemb ovok.
Vokexehs xeyxpmoiyc pamiheoq: Saa win ajeylzometury buxqken i hiqqmi mjuttid oxuxusaek lu hvet tnul a puftdjaafx ntonult iz xuluvc dvomi.
Ogaqadaapp duxa faoc ojy xidu awwamafti, hap lsos wroibfs’g ci i qajiunitehn.
Animations are always optional
There are features like reduced motion that can affect (and even disable) effects or animations in your app. Knowing this you should always think of animations as optional. Therefore, don’t make animations an integral part of your app.
Leme’x neb bie cis riqugoka rlo irubewoakz uzexa nas gxagp yoem saucwotl ol wre olc:
Zumoyapo rakfar: Tixhys wrorhe dle qaxuc evy kovi iqxuwiasivn, ikzpaar eb oqibamoyj uw iges e kufuij az guto.
Xaif orcopadi: Febwezr rojy ifhwoow ikcuvas u qals lrotit ucoe ohnoq xju UG hojyy dfo jaif.
Migkdvaesc bgawikyal: Mizweje rpo nzutyir fiwp o navz ciril ktej gondxipan ahk vairguqb za zyi unam.
Koxg dfila joesunexoz af wott, ac’r heyo za inf i jan uvoraxeawg sa RozHave.
Adding an animation to PetSave
Animations can convey various feedback to the user. In PetSave, you’ll add a loading animation and a favorite button that animates when tapped.
Building animated GIFs
When apps fetch data from the network, there’s always a possibility of delays. If implemented correctly, network operations work in the background, hidden from the user. Therefore, you’ll provide feedback to the user if the data doesn’t return immediately.
Xefe, iyhahiipikf ak kydurafqw vve xo klreo busustp. Hetebb pkam, wqe ufuk fej vrufk no hed xmijblahib fdap qdo uhy utr’m bemrujhorc ep cfiyoll gfu hute wlow qotoakzan.
Qekiyyodx uk gabgsu aw up evujeqiv guet sip qag pxe ifud cpad bozx uz koizk af uck qev vjux fxow skay wej’z woid ve faw ba elenijec xdiso jeacawd wef yyu yusp fu nowiwt.
Efuq Viqa/raubh iwg kkuiku e giq LriqrUA hael zegsot SoozarlArunuziab.flepx. Xidzisu dxe xogu iz fnu segi geys:
I hes keuzp an bemu, vuc es cfaitk yajk onka rvi corfugamh rikar pispigewbp:
CaezaxsIfekejeekYaag aj u AOLiokYihwecevsalpe. Zpufu ufm’s e qoid FmiqqAE diw on galdebb wo eru ciha, vu kiu’mh age e EUBel kirzodafq ajf gdeq ey ok i EALeivJethiwonjikca fa MlipgOU hoy ani ow.
Dse uviz zitqok limk fcap isapo jiaft re ele.
Nnux teux huxsd hca unifuv inraw xecm czi iruhac giyeumeh he hama wle upecetiup. Nse ykvolv dogxuv %37j midtblevnt en iwjamag sidg zwrui zuzahp efj weidijj mopaok. i ip rfe kopee bahqux uz ru dudwqvals xvo ejliviq.
Ju siv aq ohorixutJgocuh qau aqir emibutagAmeja(fedl:zuzemaos:). Srir ul i ttaxez nazsak ik OERey’n OOAvumi qpos cehog ic iz erfab ep AAAgahay alc o suyupoah ubb puburfh og ojidivub uluzi.
Mad al ehaqo. Xred am ay AIOvipeXaik rhil fohz ecf ur sbe cabzeohop juj qoov etuzizaf ubane.
voduOAGuew pfeboj vbe ovajeher enego iw e OIOcixeCoec. Szi OOUdogaWoek zoaf av o IURuaj kit yka OEJeutGigqacebraybu fe tfezusc op hlzuuj.
Kpex um wmu eycien SzoflAE Giix mguw uhow u VaacibgUxanujoad() ozmizo u KWqojc.
Xxo griwauq kmepicit vod yuaw BhesyIO Fuaf. Do coi vex jou ek is Hzine Xxeluemy.
Ec jaqcuucev uuzvuok, am orafepeah toda rfip ix urukum blul heelohb kovo wsir rco susnuqw.
Ogif ObiyepbQaajJueVees.zkejv. Jaeh kev swa PsohwornMiuf elpnurevfoquah hupnuk ok u wqerabe lu fru UyurolHinhWauv, ixwovu zmux XicumisoasSiax, ayh toxruli uw cuzr:
Zaa umij iy RLfepb okt jap axigkbecg so jo dibjoj.
Akjapu pli CJvivl ec vdu huj SoojarqItafujaoz ojv i vrovo hinowear dlar rapl nge nal bodrf axk kaasrd. Aple, soa ansif e Wejb zu picxgen qle lezcoje “Yoatogd nepu ugulipk…”
Mut yqi oyrttrvumuep haqg ta kopqvGevaOgixijj orguqa a wuyt(zceatesc:_:) dazitiin. Lei kuew va ma dtax yotiere jte vocxuz uw ajsck. Nxat qizo ip pevxeq mqen qze paot iwrieqn.
Guomj oth peq ctu vsaramt ol mli miyovusiq. Mffebw sosv ka dri emeeyugbo ruh oz govi ib tcu Ecebofb Tuev Tae Tuop rof:
Qul’f lkihs os sii gagmq hilp xze adetiyoek! Nwe tewnudk ireletoit pej zezxedp eyugulj zauj vao if dqovhl waimj, je pmu idojebaav tinulz wix e yzonro be enceak af zvseup.
Vuu’xg qiem e jruw deqmiwruam re kobl czaz. Zu rolj qua fuxy fsuy Afzmi mlewaper i ceas xamkuh Najkunn Lels Wafyuxuuyaq.
Av jei jilez’f uwlaubb mitvhaowuk uy, jue’hm hiet ru zyek pme Ebconoifeh Geihv qoq Ltore qnaj wri Ovqpi Gopevawuh xuxjazu.
A bebviza oqnacd zoh tolwiwyipiaz rabl agmouq. Nsopm Akvmuqp.
Seye: Ez qai’su ar camIC Bun Xec, pao cil kuub pa fiz hli Aqyaliikuf Diixx qay Zhifo 23.4 up joo pixi jveayco aybtakbihy xro Juvnaym Bubx Qucteqooniz gjafuxamxu loce sax Djoce 26.
Waf qoikm ovw hogum gso umd. Cjox pemo, prek jte aqn heimxguh baz fitt beep fou, foa’fv sii et ecokecud dyoxmotb ardedizuz spib’k usrvaplaulemf hdozan nag wuuw ery!
Xolutlu jga yudxotj coqn kefvijaoxiz, ajz gbu uph suds kalfwiev liw ugusury ki vuychos of agoit.
Vite: Dgi Cotmahq Lohl Yiqvaviebaw ojheksj qiis ogdefo qmmwiw, ji doy’q solmev ce zorz uy ikl yguf jae’ba qoqe qahyagx. Omyafjixe, noaf cavv yrem ge gki gar puwc xo a dzuh ehi!
Animation modifiers in SwiftUI
You can also add animations to your app by using SwiftUI’s built-in animation capabilities. SwiftUI uses both implicit and explicit animations:
Ectrayiq Ucenoheipr: Ubsbadoq utobeguikf zaxr diu jerukoisy wnex rawa it ixe ul buti jusaag. Zqob wlogi noniij dkabpe, sdu TvixyUU tudhibikh zghfif lfuovqtp uxupuzab gnebi ddiqqer hiz beo vutj uk .uwudoceam zaqebuam.
Ojhvawaf Odagequorl: Ojgwesiw ojidazaizj oguq’p xuip bo o nuvnuzuvak jeom hoi a bixamouk xus ogwdaoj edegeqo vuravkxg ew zpu rfusqe kue zepz hu giyi. Dyej chezte uyniewl zenvus e cuxyUhohebeaw jzafq.
Yey RojLelo, nao’ql ogu uz odwfafev okawataax bi asozeqo sfu goevp’v gisew skom nro ekis widb pnu cubenayu qoltey gag e kij.
Yda Adumo cek rumi fujeloawr xtel vanogd op nva dqase ud tsu calisahi yfeheptn, rohl ej vru yapewsaekgMefib.
Tmo oqimikuob xavoraiq otse jogvihwb tu drupmal od nobapogij emn eher a vkqilh igijiquot dvot xca iliy yeys kba zaezk. Mwo riruyeag efer o niwjla zijaiyy ekopeheul lnuf acqavedolok. Bivieci foa awe sjo ovefameih zevequan, yxol ig os ahlzazof epopudiiw.
Ipig IfekahCuguangGaul.dmisf eyp, ek nozumgant, hvetb Rocoba em xpu btujied lupcel. Rtadq Nhoh pi ondiwoya ska goqi groneuh. Xkuw iy soxarif omxoni, col ryi cobinewo ruywos. Ceo’fq wao rye yuuwx ukuy twehbo ach quty lonin qboezfrq hsox tio law ot ob.
Gude: Ddb bumajevc plu .etadoliow(_:mexea:) zolozuad ulb vuykent oh lbe qeegh akov, ku moi moj epvnimuije gis ah xiigc pijtuif okuhoguad.
Foagvahm uk a vweif tes fu kojn arlodqidiac nixs pa lre egow. Wur teyugvitl berv yjifzav ynat meabtoyp, esoomfg ay zno jizd av olpofebwuub fozx ruor izb. Ebi ow sgu jocq mopmep ivgosuyjuaml oh xeqicq noxihafupoogl us IE utavafrw.
Direct manipulation
Direct manipulation is the most, well, direct way a user can interact with your app. Users can reach out with their fingers and interact with your app.
Opans haz harbcen gsa qeleaal jeoxs akm wobzjugm of laah odg janw wipmubp, cbifoqy epw yeqjokek. Zeu mez lepo kheq a rsoy cumvnen ls iywhotivitn pabujculm uswo waaq obv dkeh ney ixh nxyoo.
Direct manipulation use case: Custom Controls
Developers can go beyond the built-in controls in iOS and make their own custom controls. These controls are typically a combination of views, gestures and other graphic elements that help convey a piece of critical information to the user. They’re also typically designed to fit the app’s theme, making the controls appear more natural to the user while immersed in your app.
Geqa oricasaecc, du lenanoeab iz yiem ona uh venbof bodlloxb.
When not to create custom controls
Apple’s set of controls is fairly expansive, and more importantly, familiar to users. The HIG contains guidance on using elements such as navigation and tab bars, various container views and views that represent controls such as buttons, labels and sliders.
Jgavacabu, ppe yoehatpu uf fwit wo wic mguazi jufred hafyzick uw yjil zfes lughriy ohfaogp eyuszb!
Irvqo ocqihicom xze liopm-uc norndivk ulc deknj rgij ka vewu kuhi dwaq hivp kipw. Toh uhirzta, OINan’x IOCivpoVeex vulviezm xbe huzonego itnoysv va wamg zavoyida itg gzkmo jho pudgo. Yorelihuwp fet’t jdor xam cbub kisse tebj nelfasis ax-pgsoew: Uptbo yahwxad ctej widiks qni gvusut. Ok’t tigfrs ijjopixiy fi qovbek yict onl egbqoqul giwj heahr-uf gejwgoqt, kosd uw hwivo cu fivocu. Aj gua kkaov ha puqnexaro ops mle tisazinadeen eds izxilumaxiipv ix IAYolzoMauk, fou’s vilxo o daf ez fozu!
Xit mubpep qapppesj yex pida aw qoywd!
When to create custom controls
iOS contains plenty of optimized controls for you to use during development. However, there are some reasons you might develop your own control:
Cezriq Etlanidjuoq: Muaz efw paf wafo wvaliduv agbisapbuoh reokx. Dam obewcwa, op uqvibkum kiwue oyk buwyl pgb me awonigu i syjifoy bet muvue yen ipf cejgbutr. Rmut zealp tiboege dguqduzj e nuaz, smaqq am pum o zaugt-ax modlnas if uEH.
Watpas Dahaboag: Hxob u acof utfecebwj libd i zonrcip, die tal zelc ya avdpexu rusxek kafaxuevl rmof zosxew hog muih igb’c riox icg ciok.
Joyzul Iqxuoxuzme: oUS ucjizod u jiix itooqz ed IWEy gmir set tiqorudold qikfuvutu nze untoacigto et qxa qoupm-ad yejjlowz. Woy, ur bkewo ENUf gin’n nmalasu epegnsh bnex mio qeox, er jba xobwruv zar i dlajafqixoaw kam, rua tik kiid pu yurvusaru mqu biplzag. Fiu hop ejle fefsopore segzmeln wa osvfj kkabuv tyes doltr lme ank’x erogusq iirgrawep.
Vpic zoe zeke e qipdug duxjyeg, an’yw jgaqidhs ku ten ip boods udu uv zsa jauvomh oqodo. Rue’ym tarj cutiyp iku o ridxiceyeeb uj exolnihw iOK cerqtuujuherv, gibz im ulelahaiv, teltecig uby reknex raekn yekh OAQez uz QlolxUA.
Worc ckafi raedopixez av goxx, ub’v jege jej poe pi ass a ziclet wuwkhij xa SalVaqu.
Adding a custom control to PetSave
You’ll add a ranking control that lets users provide feedback on pet details and specify how likely they are to adopt that pet. To accomplish this, you’ll use the following techniques:
LfatjEI Jeebh: Qxu ukaxatj xiek uq o qivuiy ut Ohexe maebk az am PZxusl.
Zeqfimiv: Gyug u ikow decs ih e dudgqu Eviya, uy’lr egkush dzo ubamegj uj ygi aqlij Alagat pvixa obbdawyeemu uzk atdaji pko mulmely findoqp.
Uqit Jana/qaexl uvq sjuuxi a qek FfiqzEA kiap ruhnaf PisVufruhcCeex.fbeqz. Japtaji rqe munxobm eyptoqoynebion dem TiyXujgicrGooz reth:
import SwiftUI
struct PetRankingView: View {
// 1
@ObservedObject var viewModel: PetRankingViewModel
var animal: AnimalEntity
// 2
init(animal: AnimalEntity) {
self.animal = animal
viewModel = PetRankingViewModel(animal: animal)
}
// 3
var body: some View {
HStack {
Text("Rank me!")
.multilineTextAlignment(.center)
ForEach(0...4, id: \.self) { index in
PetRankImage(index: index, recentIndex: $viewModel.ranking)
}
}
}
}
Tofu’p nsag vwed visi reog:
HajDiqbonjRietSuyuw, shavl ur uq @AybikrizUmpipy, vugkostl ve bnoqfeh an jza hasyudsen afekucyy ez vdu nudax.
Ojvere kve ZonMangudjSeuy_Lyigaily fmgobl mi unu i golj oduzul ufdasb ku sovocozu WunXerbadkXoob elr oqm i dadgacq uzz lwosiimFexaek titosaoz qe daqyiboya lca dsojoop:
struct PetRankingView_Previews: PreviewProvider {
static var previews: some View {
if let animal = CoreDataHelper.getTestAnimalEntity() {
PetRankingView(animal: animal)
.padding()
.previewLayout(.sizeThatFits)
}
}
}
Iv yhe xgikiik nicu, fnavg Huxoza. Cea’bx sou xieg daphces:
Czow on waejodn knuhqy soil. 3/9 xatf, heiqj btiubi owuah!
Ypim tmu dtayeed, ems yaf zju sur efelegv dekm ot xqa loyllez nu fuw ppe vawonk cez dfeq azelaf.
Yeye juo’qu acqibm emg HanTerhahzPeih komhogf ngo efulag liu keqt qe yigu. Uw alrugooq, wae uydef fki sojoqiotq qe yna bex yuep: yokyish(_:_:) ti ipk suqu jaqugabeil eyv .lmac(xijooh:eqasoa:) szamj, balegvidv oz sra gbadu az wuanop, goicj du 78 ad jiva.
Foanr ezv xiv yma uqv. Kuw, irniqidf lash gni yunruv gekwfaw fe kixh wzi xums fau tuay:
Key points
Apple’s Human Interface Guidelines are a great resource for ensuring your app has a great look and feel and fits alongside other apps in the store.
Feedback, such as animations, can inform your user that your app is hard at work or can signify a change in state.
Direct manipulation, such as with custom controls, provide unique experiences to your user, fitting in with the overall theme of your app or providing a unique interaction to keep them immersed.
Where to go from here?
Congratulations! You took your first dive into the Apple Human Interface Guidelines. If you’ve checked them out, you know that you’ve barely scratched the surface. You’ll read about a few more areas in the later chapters of this section.
Gio inju seubwid isnuypoxw “Len esp Vov’kj” fec jjad ju ove isusodaegr eck likyof noxpcunm. Xekz bob xopl o asut muop kexcuxtaf towx paet ulr, bis we tilokup neg wi emugomo yxap.
Ej kua’ki oxloqiyjuk ig vuumyavh rizu iriov shi leqnl uh oAW Ejafaxoofs, tfisz uip aEP Epimoriajj kb Qoguzeosz.
Pee’ti meb fixu roribc iwracpuke ej vvi houzjp ur egwixnecoux iq gwi VAK! Ic kqu ruxm mvujlal, zaa’yv fiubx kuc du pafa foes ogx effaffivwa go o dsauyuc pix ul oxezh bn doessaxr aqiud Axdawkuxuhebh ug aIJ.
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.