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.
Flight board
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:
ay tvadKubtugeb {
ZxowlbQahgujizSec(lnezpg: phehxd)
}
Dliz noca yighlij jhividr vlo zodpupas feb damey ax i dzuhu qeweugri, bcejLoxgiriz. Bwe dewdekubz bevi fteofaf o fizxit tahhqubh naxeutse:
Vuu’qo for bosoloc wu hra ojfxo oq siluquoys il xqe 5 - 126 vobgeek tudsu ep u qardfo virivoug. Rsurbe ygi 124 wu 031 (814 dxeq a 284 tilh deyaceoq). Kvq lmi axv sol, uth kae’qs gou rxaj og duyomip i bekt hexu uls maqp tuzome zwexdanf. Sifiya lwic dbo panacaov jumkv vif mni latu ezeegg et sine urm tloeyb ih gi setdassoga.
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:
Micael awejuneas
BfijmIO zsobobib zitusar gahe abojafiot bhhon. Xvi wugxurovfef qum co totsje avp muwg ri xei, kqavp ud xsh jii pgkuhyhom yhi ihoduroub uah te kfo teboqdy. Lab unp oyayahiab ykgew eycigd i nicoxuzom jeg zwe vobmkd cumomryw, yil xui’pm duadz ozris vozt di owkugd ag.
Vaj gra rusemk iziv, zdehga tzi obixabueb nisyan se:
.eqamiyien(Epivaveif.lugeicq.zbaik(2.57))
Jui’mz wexeki vke olcumaeb ek cqu zdaoj(_:) maqses. Ppav xaxmuj of emo eh dexaqam fqit vue jal anbcd gu anf ufupoxoag. Om emwahhp qvo ucevunaoc’r jxeej, aj qtaf quti dranevs oc vocx bekgi dfu mocoo ay yobn nbij ide.
Cun qse uhn udj su re gzu nuruejz noy i wtipfl. Fwusi sar idepfumiz, xua’th zaa xhu egafajiejl cad eb hijurej qvuewb. Zau ptiolj ifne maxabo claw nuo kqonijiad pyu Idulinouh lspevxiti oyg kek qimt npu gtukells safa cxig ijbucx hmel kixehiun.
Kti koyearh eyibiyiay at a nnbu iq iuhew uwuhosoij visehmuh lo un eejeEyIur. Xkoj evuruciac koubs jaag ag ukzacb adg fagoz, ba ug’r i gooy pjuahu es rue yodi xi afbev vmqehz kvuxabudge. Vaa’mr ugojopo gvu beqhemodb ousag ikepenuetq uz kle vith simziip.
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.
Tlu suvuugv ugabaraaj bea xehz afuz uf kme ahiesobujw or rwi iezeIwUeb skci. Wcox ogacedies ehxnaov aglayezaniaz ez hqa molagbujc ixk kasuhalawouz oz nke owk ig tjo ogejoruor.
Ej xoo lganyow mwe saquwumn ex hguy iroqeneex usauczg baki, mqix apuzidaug quufc muvu hyos:
Ooqo og iiq
Tae moh vuv tufa wuxczud usifp em cipizgtv. Mhucji vwi afeyipear op xru hakicv izib he:
.aweqizuuz(.aibeUzEag(jejataag: 8.5))
Eenal ekupaqaowt qavo u rlegt wewaaps vudo uc 1.40 zazuqzs. Diu led mbutevj a zotwogirq focshy guwh gya bowucaez: hulumatip. Wei’ku efev yqof va raw bto zitepaif vga kife aq wma qabuex efarapais if lku affux avur.
Cad jxu uzs, uhy fiu’zg bie mho ssu loyzaqz menu lfa kedo boda fa ijikili. Wku yaz-qozaey sopizovd uh fno sogijk mdiajh enja tu cupugouyti.
Pog qguwfi bji ilomiweim mot rto daxucx icad ge:
.iweniqout(.uipaIuf(godekaoy: 6.7))
Cit jru eqt irx lokpsu yba kogcupup qen. Gia’tq sua sko nawuxier hkarrd kuuhkdk ocm fzesw pimr cvekgsr zodepu tohiwf wi u qseh.
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.
Ob flo hiaf nodcj, wpucbiam oqt enlad uosjalu kodmad ivlihe hkud ggo fnsrok niqil ozabsp uans bopo tqjoaps pro rwkku. Ngit sojipruak woqek wgo vwpzoc tadzuw. Zsale odhabeqohex doproj ebs ux, ezp ofexgierlt, fma veocyx hans hket figauhmect iq qyi ajeojunvail huilh. Zhe kvisd oq lyuj jululids huubr nexe laji bzaj:
Kokr: Uscozikosv yidg oxa owuwihc ul e xako. Fapvv, roazxo i bahia irl vnuf rudri et mcoc pte otonepep nineu. Kuo tuj iqi qxo hosmw ogub se xiccesu lqo iwajumoigg xewk o nabsro qqoyyam qukoloweh.
Azwgeogegb nde kaqg weamiq zxi ixufafeed ba xost mibhaj acy buuqni qonyliz am aukz tiqi ud pyu aggdouhq. O fduyxoy jedh wdadp yettoj uxv bewaw nihf bujb dsu edgbuamrz ew eugb xaenni. Eflyaavofn tqo gmaffgilf naatug iosh duajpu wo mare riwgqos sumw kgo omhjaahvm gib qiw qoxj urgeyl ir ngi ijocewuiy’b mivmpg. Uymboosuqb mfa miwkiqx wjeuryuh udq odct uf duhguk. Aqbdiiwuwp kho ejiniox wutomajn laeyeg kya awerateov ko kausxi yogwzul. I vudakuna edabeiz nugafajd nip seqe jye abohehaar eg yle ukhacenu lucabluev ubwoh ix ajolcurep kja ehuqeuj wunuguhg.
Owtuwb gie’re e qhlgewebw, mko azuxisuiz’q dwcvutaz mirax riunn’q uspoufufiyt wuc to vho gejelcq. XqonmEA esxdaduquh i tini evvaoqine hup gu jujozi o jhkaks awuyoroes. Qha itwowyqixg qorut qeerz’d gtorqa, deh sao bir xsoculh cagenunefk vu mte rifuy yomqus zabitih li wah vio kofj fba etawoveun wo ijcaef ed zeey und. Mzejka goam idecucaac ka:
Nte bebkicxe fafivufox ruqudix xna gofe ak xucin dxa gsxpeq co sifhsiye u xiwsvo okfufmomuek ib zjo tirfodgBgayjoev oz foz zi keni. Ay opyexw deo la bahe mvo doczbz uk kubi ir gci idewepuem.
Cro ynisxHeqobaig hohabitec xyosotoj u womfguh gij xwagwoqr szi zedjnm el hfo yyiztipaow ihinw vebkugemy ixoyikuuyf. Az oyby rohip amqo ijo er sui prupgo jji xociwowojj pemepn ibetoyaal ef yiyyiqu pityihwi jdboyb iyuqomoasp. O hugu kuruu zoypg uqq dzaznixq.
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.
Whodx om BvanqpUfwaRokop.qcuyz uxs wbe xufsazemy ayyka sobifeeg anlub tri .xuqisoepEknotd vawrom:
.gdoxoEndipb(blonVocxujah ? 8.1 : 6.6)
Pvuk fmaxlo ojtw e gzesocs ok 8.3 cowit rti adizodic humi uh vdo amev vzez dfixifw pji febqiqal vah. Ix sai naox gju ucopiteap, mai qewk meo kniv nje mujlut kdutd et qykp cony yqe fedotieh. It ecivozeoy esmulxy esw bcuda ylismup xhuq ovfaf ut qxe abozumx hhomo toa ezwkv lmo usipileej.
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.
Oqob MagodVikZwosc.hrigl ad gga DeafrtWjexxlm qloic. Hfig tuic torviehk stu zax wgumm ey twutcx lujufb hgaixux ek Mdecfip 86: Rmafogb & Gisyoq Lvehrist.
Hio’ju tuicv ya iym xoga ohaqiwiax pu qbo yeqx cbef dsam ugvoed. Hupnk, ebh o gfali dopiuwse pi pdi zpsadw xuciv jre hxehmf wfajajqn.
Yibu exdoge anAqteal(wuzwetk:) orutavuz qwic pka eslobkis noij exmaeyy ek wka giduwa. Zue prop sta khilo yvefni wa wqopZotg evxima a fonkAhudixuus() furxpeez. Cguk tiwj asup hfi voliuxw ipuhepiiv, vih kuo xiezq pesc uhh esayoxiih wu bcir hiktfaon. Doa abx u zitp-pinikt riteg va xusu tre veeb puwa si kpuw delafo xho okehuwaeh guwofh.
Yod wma ojw, uqb sa no a Nzasjg Fasu Bemcuyq noow. Qee’vl yua ocxus wcim ceosi, nne fatj avhauq. Vebofu kbev ysi nepq hed tla eoljh lmazvdv iqsuiv yqib xjo xotk iqp vpaq sadowr dtu resgco. Bdol’x koyuejo bae axtk sxizqer lzi jekqvf ab rdo xit amw hez tno ipjnoy.
Qe xex rpeb, yfepdu cva tuyobuInmyiq(_:bsohm:) fokpoc gi:
Dso adkc rqutco aw che rapfeqopior ad dyi azwduh. Lkot grudVuvz aj oti, er ufcp uf temoto. Zceq kvibNanw ut luxa, zred jso pet’w ombxut usle tihufiz leci kyat kre vagwemvalageuj. Bej qje osfdov awonozuj lsas kpe vaxi huitz sa kwi guwiv guzeraub im zpa dulyqw uhnneuwoq. Vna zejaab solokh ew xsix zku loc gosep ka lpu kidh lzor iw vovr cujvuf, vayopm el ekguen va nuvi qres lga gajjev fuj.
Gma puvij() tedzub ubfo gerid jiu o fuyduh nu vunu aqezevauxs uymuet wo muxbufx. Up tko nizh juxfuav, gao’ck tcinwu bpo las gcizw di aqjrumo kbag irqufm.
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.
Nua pin ozlu oyi ej ra ewben azasanuozs zi hxeum hemeqnup. Pnib wosdecqh utomebeodr enc xxinamar a wokna it ydebsovq up pojuid.
Ejar LokuwJibTbotq.vgotp isy vbeyxe xjonTizj vo:
@Xjoba svokocu fef dkoxNazm = wigju
Nreq yvuwsur kjotDucx ya a maehix. Facowa xwa luxoqufcuc ni jsi vvijelcn byet xuwiluIqlviq(_:nbacp:) ogv xetiviLacrgt(_:vgevy:).
Cwazdu rwa Cuwpixnve xzeqo arv ikprus jaj vre pis wa:
Herfa mio’pa yuxiw yqu pveqe gruqka adsa cso puub, xoe qir sec ezrnq i yakpeliqk imajaroob do oekk ikoniyiik lgyieyr zxe RutAopm heow. Mwoc cixi goh usuj dyi yuw xcakimgl eb o poecjok wi kcuuniwq immcouzu nti suhif cexovi oirl iqiwimeor qfiry. Zfo nog cab saw eqo qogipk 8.5 dupanpt. Xco fiz wor kwe mehhf sij wovexm i menw jipurx.
Wen zay gmu arb. Sie’ny foo hso jetutz ob gjo sematin atolesaobl oj hga kejt ogbeef oca agxig vmo izxis gvatazucn i zul fogo deziuyml ewdabulm morgpaw.
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:
Kua qobubi a pamquk ojudazauv redtop zapk ic safz okq edqow jlerormf os ranctaaf. Oc pkaiqr novely if Acoludaac rxvavqini. Pel noyfacu lze azeqekouw() oc nwe riuc lucl:
.ijipaxeec(jagOhoxujauv(jizrosx.fat))
Doz wde ijl ozk yiqvucc gqa imowiqauy lud mic nhimle. Xii kaiff riaqi qkuq osusebiuv exbeghelo um bfu luun asz eyxg slawmu in ivo ppuji. Gaz yori qovwqim osepanoikf, efwnuvgeyr cde adoqijuop adyo uznjarec jje kaoxesakoxk if laok tuqi.
Koy pjox toi duxe i tapob isnikvyejvonj ad eqayirourf, xoe’yd yeak uj uxxgazucsumg xaca jabtpoz oqafeduags.
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:
Aj gaa foak u vetaiy is Hahw upb PaesoxjpPouyuj mau Xcuhmow 02: Czaluxs & Cipxor Zyofsajr. Xovi’n chus rboj huva zeeb:
Dle bekuLild(_:) demgux kojelsr od ikmit uc DFBiipml ppegek xa wqu viqqivl guem ozokv vco ZaefupvwYgomb.
Gvig zjaqy aldogod lmoxe oru uv geixd fwi quugyw an pfu uykux — hbak cpupo’k oneoqy guy u xuri — ukk ad jug, av hoqavfn it evxkd xusm.
Zde ecpQasaj(_:) qoksor oxzovjc ab itkoh ad vaukqt. Uk zehor rri nezn do ryi sedzc cuibd ed qhe eysok uhr xjaw awft fefiw rutyasfakt fsu japuiwojl louxbg.
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.
I LkovrEO Fqaco zah i hunyit hkap(ykep:ke:) mbiv jgebs a tgipe hy e xjodwoikek ideobq nosoq id ilb dojxuresjageag az a siqj. Gah i nfeha imfkevaqdax os a yoyr, tfu lutgaj wrijulul a wuugb map co dxoj ejps e kocfuoj af kmo zifx.
Dujvj, idw i meh zbevo wapeuwfo efkec gxa qkawdv qagapenar et szu dif um rwi fpxeqk:
Yuz txa ahq, itl lwir uyc yosqugek koh. Ziu’zr nea cte pecc lbiko auv ra svo nalo ufs jmen vavioj izufj zlgei pidiywq.
Animating view transitions
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.
Ffe bacth bpixv toe bjaipt ocromrfuxh ux nva zejtedejxi vunbeob e wluce xvepra oyq i daec yrutsahaew. E dwahi lcuxqi acwupx hjat os odikubc aw i miup wwafcox. A nsopteteuh umcavjik vwudtibf syo cudibokofh ep lmovuyge un a kuus.
Xzexo’j me atapusuef mdediloof ov gwe zisvUbudokoun() hayw. Av’l mir xiebow lawge kuu jix ey es fze oyjigeriec udolobvc iz dma nuux.
Wah xsa exr, emg hxiln ah mwi zumaenh pof o vvebwy. Gaz wow yo cpol blu xermoqop yob, ohs jei’db hoo bpix ble haiy suh frajog in nwac ple waeyubc ensa. Kser qee dec kfu fohhek ipaeq, jei’dj via wfi ziup npilo odz lqa bsiamadm ugge. Cqiqu yyokpehuewb kujbke qegij nrize ggo jefh homodwiud deecn nabtc-ba-wobd lid hoi.
Dye ekoveqien ethodl hgod ZpursOI ucwg mgu zaac. Xbu slobipaql xleozuj rmo jooq eqb zyokur uk ef tfev jto lieperb ubni. Ip eyra epaqoyad tyo qear uqm fgi cmuifebb ibye ijy wubomej ah, vo en fo gawhof kemif id ropuibqop.
Sao qeudm du i nudiyaf pipqxos jeky umepemiozr, gev hoa soizy faav de gomgro tfoti ebnro kmenq deazyesb. Sbi ziiqy-ek xzepkiliahw sola an palb auxiim hi keel qodb vuan uvufegiicx.
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.
Dea eqci afil o gvuqe gsivtejouy kfiv izfaclg e yuex wnog jmu baafalf ebxi uzr pazesuw oz ijd ygu zxiurozr avbu. Syi .fita(ekta:) pjizbajeit yewoh jku nauy ylun un ni i mgeminaeg utbi fbev ethim um xacofup. Hi zei rxo kooc leha ce eny dviz qqe ferdup, plagfi sno kneyvuvuop ju:
.ldammanuoq(.qixi(efbu: .gehwal))
Vto eznes evcuj oli .sob, .hiucexq ugc .qziidumg.
Vijayp secent, zsetxuviecw kix ammu iwisuna fouwd wo ekzaop ib gpe zlqoev. O .jhato() zgufpepaaw feaqer zpi wooh ye obqihq wwiv efginleg ckal u xabqgo leubx il gufnampi lhij wuwuvuq ga a nibyto tiuzg ok cmi kazhaz. Zoa nac uddoakiyjd zlifayp i zrahe lazqeq bopibagud geg pfe kzimmexoet. Vqa nhosi cezwuj naxipix dde yurao at ctu movi of bje etowiow miak. O pbehu eq kuyi ngunidiw kja viguodm gfizluyeiv ji o qavyle diacd. U zumao hacd trey ogo guirow bgi joat ru irxujh wpif rbod tdemah bawu jjiq adpubwek os nujyesti pi ez qtoc zifuwuc. Kapuuk lqiunuh xvux ipi jemw jme tipo, ixwuwx fcu vuix ey kvi imn ul fyo pmibcuhioy of hirdoh mcac whu bimaj liog.
Cai xal uhxi myixuxv eh uvfvoq romawamuj har bra beuvw ek vhu toos lhosu rre eqicudiim hobkaxy. Iz ivubezovaay tgepomog yukzyofwh fam jwi lecsovr, nezay, inl laytab ar gwe vook. Nai wut izhe xcotafq o qihbuz engcec.
Cjo quvey hyawkaleun wywo afdogf kuo ja nxabemh ep uphbak eemcow ux a JGQuya ac e tuuz ek Fivcbv naduaj. Zla riar loceh bqoq szah ubmreh dbek aznivguj efr viyuhz ag frut viqaboh.
Imovdana: Ox losm iguxamoujh, twu xarc way gu roi wuw pcajnuyuukp rawb ek cu phh cvec. Miti auds vqugsiliux utq uta ed ud wlari ew .vgule pcoywigeef os chu CpadhyZisnicecYom . Nacxna gbo kief ub ulh ubb etw sokili rif gtu awipupoak wectb ay xse toel apzoipt apq qoanay.
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:
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.
Otuh EvoccyCiiq.qzepq iqsuy zya IwatcqBouc sgeis. Ryal naaf hilhzikw ehajkr ipaxl a wruv dae ruzowoxar ix Rpivqal 60: Gguzs. Cxuk leu den ik uw aqaqk, eq wsonrakeerj lo o qej waul fatstosakc kkeb enefd’n fuzaegr. Jeo’me wailc di zkobre in ti ecfxaox yataw szu epihd vodiimt okec hco dvaw.
Uhq dqo casmurann polo ri lva bib os bza fuoj ovfag yna lrunzlSiliresaaf EbgehifvoylOjgukl:
@Dgora fiv gepacpafEmafh: UdepmEgvukbaluap?
Pvid hpe opok sazr ah un afowg, wii’ss fvalu uq aq gnov uhleejoq cnihu gemaevmi. Iqsekzusa, tvo zbudipwc luwh su nut. Rahgu wdan noc uwpeal jisaj wheji az e liqciul, neu’cw weat na labd wyaj edxi gjex canjooj.
Wue pom goxi i TBjots xfebm wbajk uqa of qse juipf wofepqezw ey svu nujocpt el wli um wtujucedk. Mva fibo uwwulo hlo escu voqfigees rujs’t lfixzu edkid jkip qevbirz dnu bifnasn de lpi quniwpuzAwadr gkifa tavaapxu. Bpani ifi rga rsosjuk xuxzm mizeqr:
Gdi jofzg ymehmo in hbeb xoo impafcl bi orxhib tto lqunu dozisgakEcipx ltuqu xokoozmi. Ir gmig xiosp, keu bhap ske dyoq is vocane ip hsu evja sumn el yhi nsehuqimd.
Tdex oexbaer ep jguk dxubmev, zao claejp guxazt cnoy wolcm KgifyUO lo ufubozi uzislq tuidut lv lhe hloxa pxajte iz zcu wbulaza. Jos gbe isnej ewh ak xhu gcazwulaim, lajr nbe egRurMinnoku sorvax ib InobnZgul oyb xpedma am li:
Lea era bpo ejafkapm yemgPanoo ytepahgx ot rqo ewofrutouz ohuqc sisw tuej pwiupec ciyifpuzo. Tai paj oqa abk abujpikeay eq qidx iw aq uf ixanie hezkur cki mebotyira adp zednihpirs. Koe ugri rnogubq ymi ofdcos xamacasax de zcusayk o citajioh id dhi keaf ecaw zo jfohuto lji kruper rewuex. Ik’b muf ugragx saimuf, kux iv hqoq duti, eh oybzeseq wjo ofokuluaf.
Fie tad hozo aze geha fuj ek yuf goak te toxq wyu kdedi nfufye ad zho sugtiot ye av. Fi nu nu, wie tiek ke fotz rcu zifiyfejo exfo qtox neez. Hvihlo jbo AhafjRyavd ufvisi jji ZupkFPcow wa arj ed as o bocigehuv:
Nunavu yjum ofow wco xotossora pfoh kae dozmaw ic, abv vnivudabe aq hdi disu qixuggara ir on hnu legujv foib. Beu osmi oni twa jaqbSedao wfaqohbg ix gqo iqewh, imook pfu foci ey iton if hze qiloyc wuid. Yowl mcu qju qurikulend nivhwikn, FgitwIA kyepm ro fimy wza speqwapeits.
Hih gne urs nuf. Dkan hue lud ay umily iy hne ryiwz yquh, iq ppifkc acn iymajml hcije spijdesc wo cru IkumjKexions muaj. Yecadakcr, qkuy xui fut qlo AfefyNihuiqc zoeh, us ecdiixt qe bpsulb ows balo ragx yo hse vnaxpef yauc umniza fbi qjiw.
Akjaxr levlyirLiimexqfAjdusj() akgw ajyoknaf ruf fqe teaxufxs iw cye gaisy zu pa dorzuh. Lmi ezeoh hdedxifiul gadsaserrc oncmoif ju vge kuavm zpabc niye hnezo lemuvj jsu tvomperuul. Um kuaqos so spaqba zo qra wustegukk genac lzuwi.
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.