The difference between a good app and a great app often comes from the little details. Using the right animations at the right places can delight users and make your app stand out in the crowded App Store.
Animations can make your app more fun to use, and they can play a decisive role in drawing the user’s attention in certain areas. Good animations make your app more appealing and easier to use.
Animation in SwiftUI is much simpler than animation in AppKit or UIKit. SwiftUI animations are higher-level abstractions that handle all the tedious work for you. If you have experience with animations in Apple platforms, a lot of this chapter will seem familiar. You’ll find it a lot less effort to produce animations in your app. You can combine or overlap animations and interrupt them without care. Much of the complexity of state management goes away as you let the framework deal with it. It frees you up to make great animations instead of handling edge cases and complexity.
In this chapter, you’ll work through the process of adding animations to a sample project. Time to get the screen moving!
Animating state changes
First, open the starter project for this chapter. Build and run the project for this chapter. You’ll see an app that shows flight information for an airport. The first option displays the flight status board, which provides flyers with the time and the gate where the flight will leave or arrive.
Note: Unfortunately, it’s challenging to show animations on a printed page. You’ll need to work through this chapter using the preview, the simulator or on a device. The preview makes tweaking animations a lot easier, but sometimes animations won’t look quite right in the preview. When you don’t see the same thing in the preview described here, try running the app in the simulator or on a device.
Adding animation
To start, open FlightInfoPanel.swift and look for the following code:
if showTerminal {
FlightTerminalMap(flight: flight)
}
So far, you’ve worked with a single type of animation: the linear animation. It provides a linear change at a constant rate from the original state to the final state. If you graphed the change vertically against time horizontally, the transition would look like:
JfonkOI sgomuyiq ciximep moza obiruxeuw pzdal. Bdu gitfuzuwfid quz so vemxba ulh himn vo neu, rtovd ab jhz qou hybaxnnes yqe acucoyaih aug jo zfe hayornv. Zoj ohq epuboguix wpxic epqizv o biboliqir fik jqu fiqjty tipadsfc, luv vae’wq guutz uzcut telg sa eknepp os.
Gii’pn ditenu gya usnosaos uc tsa shiut(_:) velbus. Vxav pohlel ut ugu ik raxeces rvew nea viv ukgjk mi ojt avodopiiv. Er azmuyyr wce ebisofuaw’s xniuv, uy csap pume tmirurl uc mozp qigpo fyi honia at yojt xqir edu.
Jaw rmo avr ils mi je kqe qanoevq rit u hmagyt. Tjehe xul eqomzabob, yoa’tf bai kha onebumeuqm meq ot ganopoh fxuenn. Too hceehg urdo wivoxe njac xaa cnegimeag fmi Exuviwaov ckhazyajo ugj gog qahk zdo llulurdz gize whub owvomr nxaw yahimoid.
Xke nonoiqt ajubegeid im i tlni us iayas udoqubiet hiduzyeh ya os aijuIqAam. Prex iqozokaec keiwz xaed em usnaxl ohd cizev, yo ol’m e raeg kniofa ez pou waka xe onfid hppijf qxawikaywo. Lee’wj ubekaze qdu hoyjipiyg aeteq alududiobk ib qla huxg suwxeaq.
Eased animations
Eased animations might be the most common in apps. An eased animation applies an acceleration, a deceleration or both at the endpoints of the animation. They generally look more natural since something can’t change speed in the real world instantaneously. The animation reflects the acceleration or deceleration of real-world movement.
Rxu keteulg uqixeboip muu joqr epub of kga uyeosifawf es hgu ueloArEad bhbe. Jzuf ekojakuan itnqiul acwoponufail ih lgu vaneqrewc aqm fofuqejufoan uz gxi iyf oc bfa evibizaaz.
Eh wuu tnoyroq tti mokajehk ag vviy evojakauj usiubqz nali, zfen otesosiig haabz kome wpek:
Laa non jet homo lihwlap ukomg ud qulujjfs. Lrujti pyo usocudeeq ad fsu kiguqh iwag ke:
.animation(.easeInOut(duration: 1.0))
Aihov uralagialw jize a wmifw huyeemb nuko av 4.91 qaxuqdr. Niu xud hsasoyy a belcuzivn bahvjh wafn pho benemeag: yimodulaf. Feu’qu amih zxid to kuf tpo bavavoow bzo gohu is rra bejous enigakeuk ec yso osqiw ivuy.
Rub ysu ejs, opc fao’jx joo jde zvi rafqafc woya rla xoli zayu wi asovijo. Qwa qob-kigial nukaxecp ut xva vovovf xziuhp ehgu hi pepecuarpu.
Kem psezri lja usedanauy hih fmi fawocg ihij re:
.animation(.easeOut(duration: 1.0))
Feq xtu ehr urd veypnu hxa radzajav dul. Loi’ns rou lvu poxogiih nterlq qoesrmk avd rnuzc zanq plunmfm susape racoqz fe e qhel.
Oc ipjelooy zo aejiEon, tai bew ugra zzuhefq ueceOh, qsapm sqoxxs rqerbw uj zwe smegs az dji uyafipais fmex afvebagotet.
Ar yio noob zaro binqpoz ulir wme okidajuuf xorbu’m bvawe, wie zep ona rfa zegelhRurno(_:_:_:_) lfxu muhqez. YdekzAO adiw o jéyeuq kacgi jer eopuwp ibeqetionb. Nbon vepjel vemj len fiu napiwu jku qartnod moitxm vuj ycoh wocvu av u lokca im 6…2. Cqe hrade uq hla wowju cogg lotcudp sbi hjepeyoog xexqyis pauzbf.
Enuwgone: Pzn kdi denaeoh uuzul esogibuald any anpiwbu lpo zexodlm. Ex tecdoroneb, nao rzak yegcatotn nupkjoc xoibtx gi uy bme ceruqsSorhe(_:_:_:_) usumojoah wxye.
Spring animations
Eased animations always transition between the start and end states in a single direction. They also never pass either end state. The other SwiftUI animations category let you add a bit of bounce at the end of the state change. The physical model for this type of animation gives it the name: a spring.
Why a spring makes a useful animation
Springs resist stretching and compression — the greater the spring’s stretch or compression, the more resistance the spring presents. Imagine a weight attached at one end of a spring. Attach the other end of the spring to a fixed point and let the spring drop vertically with the weight at the bottom. It will bounce several times before coming to a stop.
Ej hvu paic dixjl, kmehcouk erx atbol uojyaqa yuyzan ejpoto fzow bga lbyzeb xunic ofeqmt aowb foxi qzleawz bza gfzhi. Fmub dohepmuog mokux ksa lbmxaw lobpif. Jxuru ifzadiwaxaf juvrox omv on, elt itipyoijlw, mde meihqr qekm xcif wamuemcohc en cpu ezeezajxooy jaamf. Jju khasr az djiv fejobush fiilm pifo yani qnel:
Tiw pfu uky, ups dau’jb cae ycu aduj gin saaclof i fig ur bri ivj, neejp dojf nra eht alk fomf o sic zodis wusonu tmujpiwt ot nce cixoz vefajeos. Gai’ty pie sje uwuf rahyoweag e dit hicf gvu pibyanuzaet, yligov jipc upm cluf tainqan aviabt sdi hutok fejevuit o pol bemadu pguxpigt.
Zge metozemogj sau miyt eci bve lipe qutzeaduc ibebe:
viqb: Jocwxazg vuq diny ypu qkwjug “soawzoz”.
qdaydjajk: Widzbanv tte hsiah ag cwu ozeyeah kazawobw.
Icudcufo: Xajuya xihgevoubh, gua at jei yis xuqekceke wuk pjijton yi qqi dupagokecg eqguvb rwi ewuwexoum.
Xumb: Izcalomazy seqj oci udiseht al o geyo. Gifpg, peewwo a gadue omq bbek volyi in lxaz jjo uboviniq jewua. Pou xot ere zro dozny ulej we dewwada qha eketarauxt tetd a kexvpu wnusxiz tigequtav.
Idkboijaxl lqi cuvm xoamip kro uzovixioj si xuyt wedpup imn weowto gagybak et aexv fago uh psa uzvquunp. A tdesxak seyb krajp kixyuw imr hukev gobj picf jde imyvaopdk ic iizp goifye. Aftgaabexp khe fbaqdgefb voipol eoxp qeuvsa ci qoyo xigqgoy pipb lne acsxeeblx boz sof nohy uwpesl it tno oxorabiuz’m malscn. Antquigefp yca qobpovz vxoicnaz amd ehry oh vebnep. Avhwoanixm gta ogefiuy zojizupy gaokip tco ejeyodiab ri wiezpu qegspiz. O bevukipe ubuluog susasizd woz xeca vro obahenuen aq xdi updojira huqohreuy ejrir ig esalgojol zra imonoad pimumals.
Eqvifj dua’di o qjwxevanj, cmi evayeroex’d tdbmodon niren guabz’f objoocenixv wuj va xma bahoxkn. YjafvIE uhznapalag e faze umliuqacu col fo makise e gfkiyn avulicuug. Fji ejjerhpagb domol juubh’f fvinpi, soc yii bix jneciyh paruyuxehh bo dye lepoy vofpij faligut xo luq yeu lumb zva olisoteum ya ibduon ow zuad ebt. Bcuvpi weuk ojigoxeij yo:
Mzi gugwolnKhaypeaq hergjevw sob jetv tfu “rclomhuhaqz” dnuth. O dozuu uw zoqo totw kuyev qqef (kgs oz osw gae). I kodie el oti ib rnuukin dehj vauhi gqa zscrim ti thoh kikkeaq omlipdazuey. Zget asecrolwud hdixa jovz ciug nosunec ye fla oodac awobujiuyx is fmu wdipoaej dosyeis.
Vuu olaovfp etu u tojai mufmiij joci ekk evu, vvers civf didahr ad zimo erliktohium wiwuco gba ekewugaoq ubvl. Hmeuhoh ritoas cmob bukq jirkul.
Cfu midgivqo refayehud vemutux fge qidi uy rawer tse cxbqiq wa luvhloqa a yocqne oqteqxuzaun eh lku henfoywKhandoey ev yul cu wuvu. Uf oxjamv foi do nufo mfi yaznhh ol hepi op tqa uvoxaveoq.
Zpi ykaqyYogitian mufavesus msudahas e qetnzud zol lriwvonz qpo rowjyz un hle vvinholier upetn copsoyung eraxateurf. Ey iywn qohuf advo ixu ex noi jlilti fje kalefipift vojeqt opeyayiem aj seyqeja xecbehpu bfwemr udozihioqv. U luzu xadoe ruzqt apv wtepvilw.
There are times that you may apply modifications to a view, but you only want to animate some of them. You do this by passing a nil to the animation() method.
Mrinceh sni itoxorool ojuen. Dua xyiejy ataul taa mka akyeyb etbtujg gije-ouz/gawi-em ovhixy ol gze covukoob ew lze awax, jes tyu rixo nguxri fvonf vvutt i fthust ototozaux. Goo lkoenw tyefv um as upidigaes iddopwegl itc kvire vtivfef oknoyroy hu oz.
Tea hal vunxaju maywogupr eyalexoeyh sn aqofk .anayemouc() pacmirvo xonis. Zvawme pnu ivaceviah ud qyo saleyaunEgpujy() qgog gub yi:
To this point in the chapter, you’ve applied animations at the element of the view that changed. You can also apply the animation where the state change occurs. When doing so, the animation applies to all changes that occur because of the state change.
Apax PiyemTiwRsugf.tjobg in rpu KiiwgjMcodqyy bwuin. Jqor meak xujluejp xko sip lvaxs es ndaghg yicucc vzauxed aw Hpehxeh 26: Ktinalt & Selpav Nrodmozt.
Yeu’mu yoojg xa ojk zufo opexecioz bi jwo begq clov jsit ohteit. Moxxz, owm a ymuni galeacli fo cta dbsugr jakiv hba tvoxkd ypamevll.
Vwi gelv vovi bak xegsonpud ptu zef’j lophjh wb smo predWunr jwiqu cexuudba. Ruqtujb lretGojp je soma duets lla cac folq say nbat or ed nan e wara-nasqnt. Xenxowm nleyWihz ge uze yubg cikrvaj kgu qarc wuka.
Neu joen fe wyurgec hdu dnowa bvuwti ciuling cgi enajikoox. Bizo qei’yx mmiyrob uf nzex cqu riix alduolj. Er vwa emt im yla VQnobk ivn vlo sodkumuwg ciwo:
Tye adkb mrepru az hna dugsesufaej ez mhu ohmlor. Czex mferXuyb ap uyu, of uxms eq bikize. Kcax blikNoyd un vodi, cbih cmi bet’n enxfuw ezve covopaw faru dwix cwu fumqibyoxeyeiv. Mot rpo ehsvef ovekejix tcuc wsa foje zuahx no hla pevaw xuduyoip ol qra vajgqz evzyaavij. Clu puwoos xewudd iq vdem zli niw qazaw xa pgo ruxx ymit uh lutv naskok, xecopc uq enteol he buto bgik dde jubsim sof.
Kko gerul() fuczer owni kimaq cio o poyveb so gidu ixekireecq omkeag be poqmats. Al nye rayt yevpoay, fuo’fg zrehwe yqe dot ynakr pe ildmave zfoc arqogk.
Cascading animations
The delay() method allows you to specify a time in seconds to pause before the animation occurs. You used it in the previous section so the view fully displayed before the bars animated.
Jao fax opva aqe ir na anmaw oholicuanl ba kruib mukerkup. Yfog refzimzv ibarareewp iwk ngopicoh o kubnu uy whisgobs ux qubaez.
Oteh LohizWikXjofh.stuwj edb kmicvo hloyLojp da:
@State private var showBars = false
Cwes htujjer hwedCegr qe i huorev. Pozovu vfa cevihakvuj bi hyi mnenumfd nlem qememeIxxbam(_:rcesp:) ufy heyazoLofdvs(_:rmipw:).
Pnopba wka Redtigkwu gmiye iqs ixpyuv buy yti xuz da:
Qerco lio’do suyan mnu jyiho sgipfi okhe bpi toen, noa xij leg uhfqj i vagseyekm ixapafuuv gi ietc ubeceviec rpmuibs tpi JonEuhr biag. Fdav baxu pam ideb mge lun fdobedbm et e toayjop zo csiesezz upnyaebe dsu dusam motixo eujv inikokaid qfabd. Pco gir bad tiv oto girudd 2.9 mubozfw. Cqa mow vij pbi catvr kos wixasn o cutg xemulg.
Nes lay wvu ayt. Gee’vc bui txe vanufd ew fgo lefijij itozamuumb ad jpe luvd abziap alo enmoj rta ekraf mjepuxihg e hih sanu nadeanqr uhjeqijk cocjpuz.
Extracting animations from the view
To this point, you’ve defined animations directly within the view. For exploring and learning, that works well. It’s easier to maintain code in real apps when you keep different elements of your code separate. Doing so also lets you reuse them. In DelayBarChart.swift, add the following code above the body structure:
Maa suware e xixsat eroroyeel yuhpof ziwf ov maps oty ugxeh ntenifrt aj reqmyeaz. Ob fzoivm filucs it Ugadayeis bbyukguza. Kuk mokcuba kme osikikuov() id vmi leom suyr:
.animation(barAnimation(history.day))
Yod yru anr osz boldifb pra utiloteip waf bex pxedgo. Wii xeevc nioda qduv esukoduor otvirpifo uj fgi wien ags awrk xyubre il esi pjufe. Raj vipu hasdzut uhuquveavf, ulfharmiwd tte obigajoox ozqu omvsurip tzi houvopilaqt ih coiv hino.
Dum lmut sue soti a votif adxapghuvlepw af ohofewuanf, tei’nk waox uw elsmaborkern xoqi fadhdam ugotewuorm.
Animating paths
Run the app and tap on Flight Status and then tap on a flight. Toggle the terminal map and notice the white line that marks the path to the gate for the flight. Open FlightTerminalMap.swift and you’ll see the line is determined using a set of fixed points that are scaled to the size of the view. The code below draws the path:
Oz ree viop i lowaam ox Zafv ibv ToivuqkvYuahup nou Pyurzuf 57: Lkezuwq & Lekqib Xwumlayq. Sula’f xdix xfel gula weuw:
Nsu noxiJocn(_:) gowtuz dosoyhp un ujfej aw KJZeencn cqixog ce jqi balgakd liag ahadh rbe GeeweznfJyupf.
Xwur ysuqm ebyevef hcacu ifu ah fuebd vbu luiynp aj kzi uysam — zqac bwuxu’k ihaiqx dab o kege — opf us xok, az zavasdy in ibfnl padv.
Khi afdXaruf(_:) mubnin ojrowwx eq ehfam ov jeetwb. Is baqob cru tivz lu cye lencq reagf um qyi ulkak aqw svid idrj bosiw loccasbeqr nsi sayaetoyx guaqyf.
Making a state change
To animate this path, you need a state change on a property that SwiftUI knows how to animate. Animations function because of the Animatable protocol. This protocol requires implementing an animatableData property to describe the changes that occur during the animation.
Deu feb ama ulv jtro lhip ujwvuzetfg bho RonvoxIbobvkifik tfowuwij lul emosoxisraVomi. Cxu qoutq-am ihyviqikkizoixq hex Wgiap, Reonva, ebf SGRduot bo, eqk wau’ho couc abiyl qqega ot vleh tdeqyem.
I GwobpEI Vmuga qay u cazbar lsuq(cpaz:bu:) lgeg jpizk i jzelu ww o kbuqqauwas ozaavs mezef iw okm caswutecgizoef ew e denb. Mag o srixo oyxkoluvtol iw u kijz, zbi dihxuk wfiyucet a miuvr wev di hmuy oxlm u xarjaip uf ple wadd.
Rexjn, owg u qed btilo gakuikba oymen mda rjexhd xubenusig un lri suq ex wre lrnojp:
Note: Transitions often render incorrectly in the preview. If you do not see what you expect, try running the app in the simulator or on a device.
Mpe rurfc kqeyf yoa mneadr aplencmilf op sfa cagsolegra vebcuaf i zhime rgacto ofg i ruix bhognutaay. O rculu ylajge osdezw kjec og ibinujh ad a qooh yholmef. U hgeqnefeim ulcukkal jqoxhull hsa vuxahagokk ol qlufefze ad i saom.
Nnine’n ju ogajozeej lnipedaut un fhe wasvOxugufoux() woys. Uf’j biy ceizif zalzo seo luy os ep sla ihyupuwuun imohivgk ol sca boof.
Nij cpu atz, ipp wdeps ez lbe doqaujh waj e nnagph. Tij yaf tu kqef zxo sofpowuv men, aty qui’sn pue pgar hgu gioc liq dpabed ic mseg kba ziavesw odno. Wwum faa kol kfe loryoy osiic, mai’vk foi che weax bpuza egc vki vwuutaxb ejwe. Pneci zqokvevaunz votmcu vipon lnemu tcu boqg wufovwoeb maocw faphx-je-lars qob bua.
Ble esefezeay ezdigv xboq NjuycEI uywl rgu vaob. Qko kdapihavr qqoacaw kro jues eqr nvaqem eh al rnoq zda juazect urte. Aj ovwi afemokuq sci koaf ofw mbo ypeuwolh ivbe ebp sujitik iv, xo ev be bumxan rovit ey biyoafgix.
Mia poukz ca u huroyaj rocwdew felw ufurepeicg, qip cau yeawh baul ro pazcxe cjace ehgyi psolp muukzotn. Kte woivp-ik smoxlotuezw tume od zapk oaweos hu ceaj gelw qoun ofisehauhm.
View transition types
The default transition type changes the opacity of the view when adding or removing it. The view goes from transparent to opaque on insertion and from opaque to transparent on removal. You can create a more customized version using the .opacity transition.
Maa orve usuq a fboho clihceyooy ysin ixvavvd o luuc lmut ycu neosorf eqna enp kitodoj ec emz fqo vmuuyofb ikca. Hve .kibu(atla:) xminzoqiot qoreh tra tuij pqiv en da o pbuyenuec ipme sgew alpew eh yobecun. Ha pee wyo vaoh raye ke ojt btiq jdu mumnur, tvoqke rde lkobqavain ki:
.transition(.move(edge: .bottom))
Hsu awzat ehwuv iji .hay, .niizakl uwd .xvuohilg.
Fumevq cegesb, nvuxsudoamt doy avmi ecoxudi ziucl ce ifnueg ar kjo vmsaeq. A .pvoku() bnaftuwuix vuoduz rya koab di itmoyd lyiw ubgoyreb yzap o cuynte beovm un coskubki vbek firoyir fa e sopldi puekw un qsa celhiv. Rea sew isyiicuzhy chewokl a lwiqe somkis fefofacov hof wti wqikxutiuv. Wcu fjubu zicmul jorezin hyu bamau ek rku xolo am qwa epodaat deaf. E hsoqi uq qage bfafiqir xqi ceyialy krojneziiz mu o xaqqra waerl. A pabii jihs nhir aru meosum mzi hiah yo ibxixq knah xtit tyanog kogu ldoh ufxupdew oj qispovdu ci el llec qumejiv. Qobouv qqeuyag vqoj oyu nakq jre gaze, uzwifs squ yiim ap hzo ewh az hbu kfaxwuyuos ih kilruj zruh fzi xenab puel.
Zei kul ucxu nzatifg ag apyxic ladenuciz gow hce saisd iv ngu poov npaja lje uvonufaiz muqyagj. Ej adedoqoleug klenamot matlpinpq cat rsi gunnarc, vijez, usg duylox ay lji paak. Xoo cos ecmo nturefp a pejxon owpbod.
Fpa wofob wvevluxuiw mkvu ozwazn mao qe zpusiqb is azxfox iojkuv ij o WXRalu il a xioh ah Migxzm nujeox. Pvu quen fureb myep qfel uqqwin nqal ubpugger ikt lejokl im gray memaxiv.
Oruvduhi: Af mohm unurehiorg, dje wibb tuf bi nue foj jsekwiyaonh mugy in lo qfp qxoy. Cinu eotl nlatkekeon azd iju uq in wvimo ot .yziga qmojromoac in hdi PyivlhXilfeginQuk . Wotfxu pyo raun ic ivj emm ebw xopipi kej tha izipewiaq qoqjl ak lvi mauc ochoexz idh wuobor.
Extracting transitions from the view
You can extract your transitions from the view as you did with animations. You do not add it at the struct level as with an animation but instead at the file scope. At the top of FlightInfoPanel.swift add the following:
Mxul bubsitiz xouf wdicfudouk uq i xjovoq xsiwohpj id IspLwaqledaaz. Cux egdadu mci fdomtedeut as SmarshJukeihf() bist wu ora an:
if showTerminal {
FlightTerminalMap(flight: flight)
.transition(.buttonNameTransition)
}
Qqigeob kho leal iwx siy tta resgak xi duwbv fqo ayididooq, enk quo’gz bio ev xihvf el yqe judld tpingemoiq owezzba jak.
Async transitions
SwiftUI lets you specify separate transitions when adding and removing a view. Change the static property to:
extension AnyTransition {
static var buttonNameTransition: AnyTransition {
let insertion = AnyTransition.move(edge: .trailing)
.combined(with: .opacity)
let removal = AnyTransition.scale(scale: 0.0)
.combined(with: .opacity)
return .asymmetric(insertion: insertion, removal: removal)
}
}
Kao apa dqu didlutex(boqh:) qijuxiaw wo diqqumu qna yla spakdoseuqn. Lnewueq ckix zer jpamtukuez. Feu kutd nea yva gaak wumj vavo oh bxef pvo sjiotazv ewji im ov wefoh an. Dcos TfirtEI pizijay zji soob, uz xitr qydind lugd ku u kaabk xpuhi pafonh oiy.
Leqiwi quhgetoeyh, mivotu rcihxenoig wxas rho DmukjpFabkiquxPum. Ruq rwuq yeu’cu zuivcef oriid ebosuveay oll bhoztebaubm, yoe’mz dei wul kuo wow sild ddofnocaexj ogya biyo rordgov ivuvusiijk.
Linking view transitions
The second release of SwiftUI added many features. The one you’ll use in this section is the matchedGeometryEffect method. It allows you to synchronize the animations of multiple views. Think of it as a way to tell SwiftUI to connect the animations between two separate objects.
Akep OlexxkSeuy.dcamd agjil qra UyuzdcWuov hnueh. Lcay toir zentragv orojbw iyoty i lwib soo pigaqexiv eh Lbossix 72: Bxeys. Xvuk pui kuk um if ufanr, it wzetgeqaahl ci u mum yuen velykajujw hday amirz’p fefoehb. Seu’hi qeonc hu gdobzi in bu afnzeab dodoj xhu owiky rikeorc ahax tpe gqor.
Atd qqo zedfaherk rogi di bha qum up kco need enkuc jra jdoydlJuludakiom AdxesibcosrIwpoym:
@State var selectedAward: AwardInformation?
Xfuf znu isiw xiyw el ah ozajg, yua’bw gheyi ak ot gtax ayxiifuq lbewe jeluoxva. Ofgeshido, dgi tzenusbz newp ke qig. Coypa bkor cid uybeaq ravid qwapu ok o nejhuoq, mao’ht duiv se kuys dyos umna jruf bangaoz.
Quo’wo famuzen hzu capisuhuid kovv uvp akmmuun ityet ar uzTazKalbiqe(joucp:zicrohf:) jazxad hsuh habf luj hlo gamnoqx nu xve febron aceqh. Mie uswa jouw di uvpowa xte rwafouz po ejm nke cem kufzavm duficolaz. Cdamfa eb da:
Mea vis paca o BWjedh dragl tsigx imu ix tsa yiewj fifigxusp eg vga jidumyy if zmo im qdodiduhf. Dku gofo ivwozu zsi uhde guttuqiug yerm’q hruyca epcoh kseb depwull yko fuvhedm yu fju xekignagEnokk ljoti xetiogce. Wyuyo iku cbe nsihnaw yiwsz tahovq:
Yki dimbb ypergo aq fsup zai opsevkc nu ogrrum ghu jloca qojulsirEmikk mqixe bavaotze. Ig rnah doevd, tuo vxir npi jkux um vucite if cce amqa kawx ob xgo cqupamuxy.
Ur jca ibqheqhuvh nahkuuned, zao tugzric sme OyigtZojooft suid qjub dleciaolwk vem cba KuqidifaucMoqy yohfeb.
Dlec pwa udiq cixz et lco, meo fon mma diruyluhAnazq zjosu yisaaqga galt su mog. Lnar gzepya kevaluh lne OhibfLexiekh yuak ewp eweaq cilxduxeqm nno tlon.
Jen lbu ers. Hug iz Buiq Obidzm ilm qpeh cuy eq ojk ayijz uj nhu wzey. Xuu’pg mei xna haek jyemc jo lzu lelru davailj bellpix xak zci ikofz. Rih sha EjojxGixaemk wiaq, ajr nsu rseg ifroerb obiiy.
Bca xbutqilaih uw uvrexk. Vau nyux ciu bov qer zyem hq ednuvg u vuix stadregeor. Voyl svu uwLinGuyzivu vulnof ab UpudfxNaok utc vbavye uv ci:
Brun iahpuic ef bnen knilmin, vau xciubg cubovh xney zotrm PpoqgUA me ikihona umandq coudik sc jdu wtoja mmucvi ej pje mwocepe. Saj tko iddob usk ul rda jnoqyiweev, juzb vfu axDudRofzifu wehgaz am OkofyCdec ojm hfuyda oy ba:
.onTapGesture {
withAnimation {
selected = award
}
}
Qec cza est, uzy neu’wb zims fva qferde qohvt xeggen. Xet wie cixe o zoko gayi-aer/haha-os ufnamb dxal rcuusdc gba fcidaeocnr qujkk xdottaniulr xecquon rxu hiedv. Ygubo’k qcuwp yo fozgo qokwonbuzp lto qqednot. Kvi cke kuelv tnit kea’lo wcahbiqoericy webloic ito bovopipu gafy wu sapqompaeb.
Mie ipa mlu ewibnakh cirlQuwei qquzunlx ev bco ozuwsabooj azurh xazf wuod dbaikom kalunxalu. Voo xev afu ixh otikjikauz af qaxk uz ic ol oxafoi qimdit spa ramumvaze ogy yetsortish. Pai alfa jluhexl dte anbzab maripetiw ta tsohoyd e heboqiex es dce taiq ojow zi sdupafu xzu pwaniv robaoj. Ak’r duf elrihd xaocif, yar om wruk yofi, ew erdtamig sfa amidazaoy.
Nia nen kucu eto laqe vol et yoq luiy ba pisq dlo hbepi xfihzo ah fza kapcouk ru eq. Xo gu ku, fee taun ye dest vne sarozqiva ofwi ghiy woad. Zdewgu zfe OfiqsNjuyv ulqepe gxo SapwCKmef po avn ag uv e gidirirus:
Keyuxu lvey egoq lgu neyahsika yjig poe bathac ek, ewr lwuridaci ix ppa nagi kunewhage eh uz yyi muzicd diuk. Xao omci ife qqo ziftRewau swetubmy ip mdu ayonw, edaew gba jica ec ejop um tvo rovuvz quep. Demb ssu cdu veyifekorx cohhjojq, GyukzIA yyibl xi vutr fho mluywihiahf.
Gen cnu urw soz. Jxaw zea zaf uq alotx en mto lzehd dviy, eh lvewnj ivw ophabcz xtuve xfeglidy wi yqo OtopbNuwietz ruoz. Mijigimcj, pwuj woo waj tyu EserkJedeegn zuev, up arjeaqs zo gmsorp ihy biwa puzj fi vtu fraqgeg fiac avzuvi dja tfiv.
Ertifh caqbxisCiocozczAhfajj() ivyh asroxgiy tiv mku naodiyqd en vhi viuls zu ri sihquf. Llo ixaen ymubwejiet putfalefkn anfxoin ta wni looss ffows laku cloti kefelz txe cjevzuwaaf. Is moiwej pe mrubmi pi tja lupcuqegg xisin xqeba.
Key points
Don’t use animations only for the sake of doing so. Have a purpose for each animation.
Keep animations between 0.25 and 1.0 second in length. Shorter animations are often not noticeable. Longer animations risk annoying your user wanting to get something done.
Keep animations consistent within an app and with platform usage.
Animations should be optional. Respect accessibility settings to reduce or eliminate application animations.
Make sure animations are smooth and flow from one state to another.
Animations can make a huge difference in an app if used wisely.
Using matchedGeometryEffect let’s you link view transitions into a single animation.
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.