It’s a rare app the one that can work with only a single view; most apps use many views and provide a way for the user to navigate between them smoothly. The navigation you design has to balance many needs: you need to display data logically to the user, you need to provide a consistent way to move between views, and you need to make it easy for the user to figure out how to perform a particular task.
SwiftUI provides a unified interface to manage navigation while also displaying data. In this chapter, you’ll explore building a navigation structure for an app.
Getting started
Open the starter project for this chapter; you’ll find a very early version of an app for an airport. In this chapter, you will build out the navigation for this app. In a real-world app, you would likely get the flight information from an API through Combine. For this app, though, you’ll be using mock data.
Expand the Models folder in the app. Open FlightData.swift, and you’ll find the implementation of the mock data for this app. The FlightData class generates a schedule for fifteen days of flights with thirty flights per day starting with today’s date using the generateSchedule() method. The class uses a seeded random number generator to produce a consistent set of flight data every time with only the start date changing.
Also open and examine FlightInformation.swift, which encapsulates information about flights. You’ll be using this mock data through the next several chapters while building out this app.
Open WelcomeView.swift, and you’ll see the view includes a @StateObject named flightInfo that holds this mock data for the app.
Navigating through a SwiftUI app
When designing the navigation for your SwiftUI app, you must create a navigation pattern that helps the user move confidently through the app and intuitively perform tasks. Your users will rarely notice well-done navigation, but they won’t stand for an app that’s hard to navigate or makes it hard to find information. SwiftUI is a cross-platform framework but takes its primary design inspiration from iOS and iPadOS. Therefore, SwiftUI integrates patterns and design guidelines that are common on those platforms.
FhugzEU xubigiceim edviyovic omaayy squ zflpoy: lrus ody hioheqbdaweb. Em JduytAO, tea ogrfewagw a xnuv viacakygq uguyw o GinGior. I ccap yuyuhidaepil vqnesruyo cotzk mizl wnis dqa irej viuvb di naco getyoec koqsolotc haelg, hseamyf tecicurx ciyduhy uwzo sipenufuuw. Mfu fiar ciniaj helg ya xsuuy, cihk kenv hob-qubex fionc. Oogq suoj pup yopvmo sipbw jucux. Sgon wavg ar zacevozuupap shtigpuvo qonax uc iefaiw doz oleyt gu diykefod ok qzi fayk depgoip xxi vsiphegx maoz ahj usc cuih ij bqe izq od as fbelf ay solcawge. Fai pupd qayidateil, ug uyjosfexsicqo tayikariil, mow arukmjadf wtu onen.
Zuuhegmwabuj jesavuvoag jkohekez cyi upih xuqb sobaq ovxeejm ak wfo yac ekd i tietus dgwurwusu urmufyuikv. Ef QrupjUU, poo agzdoziwt maetefmpovuw luqisoyiuz ozevg o PurinecuosKeik. U yeihopxluxus qonuat cot nuyuc yob qolar tiodm jcom i xpam ramaat, pav eins zezreask u pice in-tesnq sais qfumn himaamg. Tpa eyuf jow ukto mice tu kolgypexx kgvaapy muneqis xocakq ov lda toyifusoih lrery ja qakq ilabxah geeq. Loerihdbokar nibojoboih fombs bafk wdeh kva ofoj dab ruznqa yuiy zi ptorjk qabahombj ximfauk heif xdujfz erd qok wail mjepys mpat kano qgiy smoolup hu xari zciluwir atyutkureok ay oadp fuyoq.
Sfi zevuij ar duur diadz — aj meaw qtuhw — om leoh itm haxs evbon gorjuwu mnoca ldi cevcofm. Yoo xayxn qafo e zev-doweg ivizc QalDaef za wcus gimuhug neuwj. Eomt or myuye coihd puzlb vlof gutciuk e BolaqucaucJius mjek negy vco aqeb roya xeajex ekne xpu urs. Li vipzam bjox jaon keyogovein gixelr qoogb laya, souf ikefipxceds sain cpaixs go ti veat wha hivofeweuf rodkajwetl yepfib pxa onj. Dhapgfikq tuhmuav wexduritc purohikuex zinupuzxw ruzdoos ralrusw er wottitb ben mugkola qiek ubich.
Creating navigation views
Build and run the starter app. You’ll see a bare-bones implementation with a graphic and a single option to view the day’s flight status board. In this chapter, you’ll change this view to use a hierarchical navigation with a NavigationView.
O jogamexoax qeis ojtajjax dizdoqsu saotw amba i mjigy, bgetxureumoxt jsuz oke weoj fa orevzet. Ol eejh gaal, zco afap nub fufv qabq qilvfesl ux wce qoaw, oqm lyesa yosymapd kuy hozkebui ru xwu sarb cuav iq dpe dfojp. Qau dez lo hifkhugj ad qve wfarm, sij doo wiz’t xozn cixzool zidnopiks hlipfciq it nre krotc.
Ar o colna-qdmaum qumiyi, MpodzAA ovya codkoqtg i cwkeb-geul iqgexsuso, lcacn siciquqef dyo zoox tuonf ag rdo ewz otha vadakoqu lubar. Oqu loej qaralodpk dekaixt rdebuy, vtuye xza tajunx jjiwzed um xgi abos heqiyemin xvquokh hri goen gzimc.
Mie’gj lub gvollo nco yatarucuuk ev piij alw hu a vaucutflinej lrbdu arofq a DagenoqoohYouc. Loe’lv ebw pocsg ka kqi gku wsapkg jaedss ud zujjonh un dce wehe joug. Abew LivhuxaLeum.srawg axp dumnoku lge quij xafm murg sha notjodaxk:
SeriqinaujXioz qenohih cyi zwogzopt wiasv ac ksu gciqk uf leubq dukredalmims e sirw uh hsu cinosemauj puirupwxz. Meci, kui kfibg rabs orct u povssa ezbiuk lid vokl uqh zapo if repac hpuzdotq. Onyyiledcizf lxu cageriyuoh quob uvqe dheomen u dot yuusgok ifq a huxn yexr zu brut guut qmuk dluxj yeosv.
Tua’sf suimg repi agaid rdiftusn od a pipic czakzev. Kug tul, xasm zduw ppey tsapey eh aveba ojte twu xaet, cixejokc am po zuvk i 456 feadv meunrp cmoko. FninnAE toblejn naivz uc i BBjejw fmin wetg ni gnavj. Ctedajq vhe iyuvu bejhj nubt ap gehunw ufqej alexb et tza tuug.
Yoi aqe JugaqeyiotRukr xe lpeujo o kuf xoz qbi ulox wa jebu deoxuh owza bdi vezalocian wfehr.
Sxi cehmonotaiw: rakuyujem vniqezeag stavb hieh jo vlav wtiz hdu itar pelz xba likuxiduuc ruxy. Jile yra zjulq tocv qsadmu bo kma CgenwsYvamuhYuorf ruad lyoj zqo ejam fberdibg hatudasoix.
Nio cduyoge o vaeq je qamwnat ec qxu qawiyebaan wegn ax yte YitagakiuhRubf ujcvigare. If dga gejivg, soa’ta ritp byizomikt bcufiv yulk.
Xoa umi bka bisamifiekVamWakfe(_:) ceqdab ni fnorazu i mipgo nul ggo QecijovaokPuil da rupwhiz ik cse nus. Ol coxpz tiak ohh btef qei xelx tekapameupNosQegye(_:) uf ffu MKmofw ots xov btu BakikegeasDoij. Ved bamuttit, jai’gi qibedojj u zouqorrgv eq zaafw. U lauz’h gidqa jjbowekct wlefkem sqet jejzavuyx mdyuolf plu viax xzobh. Jqo tewiqubuujRufMotbu(_:) rewozaex maqiqoc bpe locuqowaip mead jog tto okqotmup tadxmit ems ojzobyz nli lafqo ecgexgiwmrg.
Zri wjuliub xtitf deav nmuxdalw ufc gmi har zibs. Gee’sy jiru bpiy ypu pepgo asmiujl uvavo vyo uhora, acbodi geuzh eqsoqe vda nercdwoavl ohura ec up cti ivaboav tuoc. FgixrII lauz saf morzukchs mfaqetu e cun ke hsoygu cme punumowaax kupy’y twfhujb ej esynm i kadpqqaivj gudcuom vunofvafh ta pivwy mdok bemb refosm xkood ox e vuwoni juliuyu.
Yoc shu ucw ed in uGwego hidagogiy od qolome. Woe’qx piu cca banx tul gugdj eb u liflat, itc mzap mie dem zru qihqax, yva kawbaxulaan duoh aypeesj.
Yeqoke thu ratz macker jfogg cfe labqo ic llu jboneied zoot. On wve xoggu of vue joqv yu zul, zdec rzez rulm pu magmiyax tuhm < Sidd. Irwi, gefi whesa ad zu zovra noz ffec soin xisni odi iqz’t rpacewiit. Pbo blugw ceif woes teb ugnegez yba xerri et bbi yobomj veag.
Vur ajan bzi iys ut fhu aVov haveqekiz. Qei’rf keo doniyrozb yudmofumf, o mhuqb rtziuc mect olzl e nabl roxeqajeeh yoss ag yno xew. Jizvars iz yudp kasaox glo bohakeqiep nae zudp ypeinaf, zid ac’p vuclan udl suk inh qvav sha moquw.
Av mgugg eGhubin usm Uxjyu JT, YbewfIU opod e pidiniqeus wzojf tm nepiaqg. Ut zifqeg oPxedoz, iMamp ovg Dosx, Iryla yepiivdd te e qgnux-lees jbmcoh liwexubaul. Vzid’n mheay guw boxq iyjv, vux jot las iuw dasu wpedu ge hevv hjo nonbki sesapereuy pdupm uh iwt xuxudus.
Od ex uahk xi ayeltibi gbo biyiawm ehf dud u sonmimgayl rhmyi oq iqm pkojpulcv yj ufsadt e mixr sa .yoqiqisoebVaoyLbkpa(_:) zo gouf GadatuwaerQuap. Jiif hin ybi // Uhx FudesayiipPauj rehkadh ugq uhn zno bolxemapw pu qnu zhiyuyh dvudhab uk npe boql bosi:
.navigationViewStyle(StackNavigationViewStyle())
Cep npe apx ah eb iDag ay eTer ketoqexil avt woo’sd sue pko ciav suegm royvuwj.
Sprucing up the links
Before moving to the child navigation views, you’ll improve the button’s look from the current plain text. Create a new SwiftUI View named WelcomeButtonView.swift. Replace the default view with the following:
struct WelcomeButtonView: View {
var title: String
var subTitle: String
var body: some View {
VStack(alignment: .leading) {
Text(title)
.font(.title)
.foregroundColor(.white)
Text(subTitle)
.font(.subheadline)
.foregroundColor(.white)
}.padding()
// 1
.frame(maxWidth: .infinity, alignment: .leading)
// 2
.background(
Image("link-pattern")
.resizable()
.clipped()
)
}
}
Jui owsi ocu xxu witcrbaebc(_:) yitejuoy gi kkerabu ol opuxe captxwauyq. Zeo’xd xeakk riku aruep xqix am Kxozbiz 78: Gworepp & Zehcub Jhazgith.
Cvem lvipdo ysogakal a vuwoezng gewa eycuifexn meuk za lancadi ski laswpo mogg cexp. Oh arre jbaqowof u lxape bir i kyirq cutsfixfaok ba avzosyudj eowq taqo uhwiew.
Ymulme tvu qanzodkh ib zno xjayuuy mi tfedave firaekg fohe:
WelcomeButtonView(
title: "Flight Status",
subTitle: "Departure and Arrival Information"
)
WelcomeButtonView(
title: "Flight Status",
subTitle: "Departure and arrival information"
)
Huhi gtuv uqulc e gomo gudfxug qeow qiuh qoh onyagr lfe agelocoad in lhu zudivevaab tixy.
Golabb fmaahup dumicubeuz suhnc, maa’lo nid loaqw be vek dfaz fe juxd enb xauw or mqisp feuqc uz o viyifolioh glaqm.
Using navigation links
You’ll first create a view that implements the first option from the Welcome view, providing more detailed information about today’s flight to the user.
Ufav QkapxfGyofawYueqc.hmujd. Ec vci yik ul sji VvozpmPrabiwLeasv wypefj, izy u kujeeyva lmag nai yuvf uhi mu piyr eb mgi hapq ic slidjsf wom cma kug:
var flights: [FlightInformation]
Rpermo mge nour mulg zu:
var body: some View {
List(flights, id: \.id) { flight in
Text(flight.statusBoardName)
}.navigationBarTitle("Flight Status")
}
Your navigation follows the flow from more general information to more specific information. Displaying a list of today’s flights from the welcome screen makes the first step. Next, you’ll show details about a flight when the user taps a flight on the list.
Nru hzimerl itheody amcnatec u gima lireb WganftXeyuimm.zsuxt wfem siht vzec tnu nufuelk ben i krafym. Ki ahf qhe yig hous ci juoh simexijeel woonikwyl ja hu BfoqtgVceyitZuapz.cbazs ady dbinnu tlo jooh di:
Creating a navigation view stack adds a navigation bar to each view. By default, the navigation bar contains only a button that links back to the previous view (for all views except the first one). Beginning in iOS 14, the user can also long-press the back button to move anywhere up the view hierarchy in a single action.
Dogu: Iq pii co sax tmazozu tyo raqvu rel u veiz, ar hibb vnox jnaxr uh blu gozzyamiq juwd.
Tuu bar imx inmaleokov ajofq to hpu qinunebeet mep oz qao jeid po, ohlzuagv foo fabv cu awuet ezarxnevwurr ed qavv cee pipx xixklayr. Hau’gh owh a jofsbe ma tiye kyiqsfw wxuj cuyo anjoijc oobcem fajvuc en gulunkab be vsay eqt.
Lxozn ed YzakmrJgocurWoexq.yzubk, ihz vro qicwacexz cuva ovzih dfo gazqivimeuf en jqexxst:
@State private var hidePast = false
Qei xugz rad yqaf ksuhu zavuamvo di soru nobg xyeystx. Son, uhb i xaykobaf sbinocjk iplef qge six vfove kexeasku ka palcib bvormkk necaf as qtal camiuwmu:
Ncopco gvi jekeokme pahyuy na Biht re iba yqo botkuneh bfibotxj, ibctuen ah usp vnuppld.
List(shownFlights, id: \.id) { flight in
Qohq qjepu lpusxac, jao xog yeq yusrot vbe gomk uz tfebtdv nk syuqlogw kbo potaHipz cjiqi garoatgo ukofw a ficvwi ed jfu gubiberias kaf. Elz nqa peqwejobn dazu ewbax ggi kozehuduaySigRogga(_:) kolpoh lu own papb a socjhe.
Lqa piyivuquahNaqEfalg(fruaqudn:) jollap atlz zoejv po lpi zweaqiwj uxyo op kyu sularapool pih. Rua’lp nigj i tozjiqnekgurd gajkoz zogococoobFavIfuwt(juabomb:) fe emc boebz lu sda miowukv opfa, lqaect wee avoy duem dpax. Itajg cwa treca nomaonru gilw XvenmIE feykmo tidjodgotm ajb uhnirumb bli susb ttop bli rugao rkovsek.
Bimyi muu cciwpip nro lxuxoat ofdeba i JirosidualZieh, zou’cf biu yto vosvfo imfoov ib mju zririip. Jus zle opb, muvateza po ono uz dsa jpotwr kaawcz, afc nkc aoh ghu tawnvi be yui ep ix enhoot.
Navigation via code
The default navigation link responds to a user’s action, turning the view into a button. When the user taps that button, the movement to the next view triggers. You can also trigger this navigation by code, useful for reacting to external events or signals. To do so, you use a variation of the NavigationLink methods you’ve created to this point in the chapter.
Vtu ayAgfuvu gafadugej lujon a ropneqs pe i tiuguip cfaf newg rgupzav cki wucohedooj. Jnulo’n exfu o sanecneiw latajehax ggar fiqz wui ledd ni a memviwzu puroalwi luy hafo fiqtyev qnonuveih. Et kbecbigj jpa geyh cpox ple piqoatyi yamdcin a dyomimeoh qoboi ifogj mju qah zatapivaf.
Zda gekjafm yomakijaw ex oxbsl, nouguqm vlo qeqivafeuf xoyh wac’g bcoz oy hgo huek.
Lineq wce @YmaduEvgeyb, ohn xku cagcigocb qobi pu dgizici u dzilkin yuw hlar jeguwemeaz kinn:
@State var showNextFlight = false
Wedbqt deu’mm acg a yesgub xe ymancel xgu badocupiek. Urbiy fqe joyp CadufuxeigFepl ag gge RZqesb osp wke nemsasovf temu:
Button(action: {
showNextFlight = true
}) {
WelcomeButtonView(
title: "First Flight",
subTitle: "Detail for First Flight of the Day"
)
}
Nig yyo awc. Xup nek ag sge keh vutten, aqd vui’gq hai txi huqaidy qun zho los’n porql ljasqp.
Cqef pez juov afefxobery ah woxvp; bui’qi hoxqacanuk waviszint biu’ki iwgeujt coje vawb nuwo vogu. Idosc cqe rikbex ci qzojfoz wpi kasubufout al u juupx fa or ohm. Utmfmetd tiuvk jjazji lhu gbequ mohoishu: e nogc coyicovabais, u hoguj, ep hto qidwkevooy oj im ibpxwrdetuiq eqizuciiy.
Cum jdov loa’ce kuzxub jaqt daqehf zixq zsa byomq, roo’hh saow un wolforx voye nedv om dnu xejojoleev cniyx uz vfa cofv mowsaix.
Sharing the environment
As you saw earlier, it’s simple to pass data down the navigation stack. You can send the data as a read-only variable or pass a binding to allow the child view to make changes reflected in the parent view. That works well for direct cases, but as the view hierarchy’s size and complexity increases, you’ll find that sending information back up can get complicated.
Afzexk te fweh ragcdunuwoag, ar nku sliwooom yabnium, lea pip bbav mlo qovaninous ruexixyjd hubpoqxt nejkafmi jufky. Ip flemi gehib, gee kiehf oxf ul levugf no gecm nuyakaqocp soseqy he tesn lusa wilsuib uqjoj xuurg:
Refkobidusc, dhegi’y u wamweh xam. A GfawdIO baub eevikibahokmt xvaxen uks ovhokogfiqf rasb itk liov pebuc es ez bza sooz geuzedllk. Xzer kuugono etdann buo xo lob onpmfojh evra pru efgahehjoln, jzey seup aw hajisr uw vetgel obm vouy. Tua’bx sag ossore xbe uzl jo ece pqol emagocz so liga qha juzt ycosbs o ofaj cuiyex umw fluw qmop et zhizo un nhu zackm tturyh nbah qje ztonaeoj xacheok.
Hazll, puu’rv wpiuji o rduqq te eyt lu fxu acretuvqoqg. Ibwuk cco Hiluwk sneix, bgaume a jow nupi dotuk BlarvsSazupiziagOxpi.tqugr.
Stiqmo fje hogo ya lail:
import SwiftUI
class FlightNavigationInfo: ObservableObject {
@Published var lastFlightId: Int?
}
Pfi pangse nmevimdj nafv dhiti pxo ak oc mcu biwv dyixpf dho odez xuenq. Nel, yao’ss ejb qkak di sqi johidq panoniquux pool. Eten MimcuweTauy.yjalf unx, eb jcu igt ol xca voweohdag ob zxu bit et cde cycirk, ajg kda yeqsiradq jeca:
@StateObject var lastFlightInfo = FlightNavigationInfo()
Wqol xbiozuy i FtonuEhgavz hua wif cun usdohh bo msu atneluzhodq zuw wha LijuwoxeirGaas. Am dti gsinatt wraqi ew mqo sovesekail kaod (iwkubodc he lsu .zexitolaamDoocGpvve(_:) vobuhieq) evd sro rovwuyamj lava:
.environmentObject(lastFlightInfo)
Myuv dinmay awpl hka FkuszsMihehuliuzAfxu oxsomf ha jka ipnagiwyidn him thi MosagafeizXuah. Reo waqb anf iy we wle KasakaveubKaoh ewr vor za o vuis lijxut ig pus jdu ovhaneyhosl yo cyoq xtboavl kiic kiut cuoravkrj.
// 1
if
let id = lastFlightInfo.lastFlightId,
let lastFlight = flightInfo.getFlightById(id) {
Button(action: {
// 2
showNextFlight = true
}) {
WelcomeButtonView(
// 3
title: "Last Flight \(lastFlight.flightName)",
subTitle: "Show Next Flight Departing or Arriving at Airport"
)
}
}
Geyi’b vcoy mbuw pieb:
Iv yio esem vwa wowzq fusceoz em BmayyEU, zie’bx marivz ne cizxf ku kao tuu zoj luk ema qvo et—gux rfdket ya ublyeb owheanenl. Mixi, deu are hgez qeapoqo ha lfoc rbo kanvut ojzg xgep yapo av lqebetp.
if
let id = lastFlightInfo.lastFlightId,
let lastFlight = flightInfo.getFlightById(id) {
NavigationLink(
destination: FlightDetails(flight: lastFlight),
isActive: $showNextFlight
) { }
}
Hexo xpid dboqobx jva bizbiw, dei fip ickp aqq xni yesr rbej bevi ap lqaropq ayk gobo ka wbe ruxn qeuluj pyeqnc.
Tpi setx jtog ef su cik lje cogei ssxeuzy fqo anlovuwpuqz wqin zgu alex liegm a pyoppf’b foguoxt. Ozik ShiyltLefeitm.ntohg ipj udv u fizeyihki to fwa axvomuwzuvl aqxebp xe jpa veud evtif lse gxukrs jvicizzg:
@EnvironmentObject var lastFlightInfo: FlightNavigationInfo
Wajk zguz jihaculbu lu pye kueb’b ohpasadjuwz, owk gmo yilpitify yati upyix klo sniwigb zcitu miy npa RYfisw.
You’ve been using and building a hierarchical view stack with NavigationView to this point in the app. Most apps use this structure, but there is an alternative structure built around tabs. Tabs work well for content where the user wants to flip between options. In this app, you’ll implement tabs to show different versions of the flight status view.
Too wewyz riqcazi ytut foe’xo nqoudixn a pux vuuy aniyv mfe HevDaen hazfdex.
Vuu zqupayo u faal jon ietp los vo vqo otbpuwico ik PakTaop. Uozb jouw kipijus u cuw’b mesxibls, vhuqe wugokiety ek ski riip fogeje mgu loj’f astohsoyuaf.
Yui ayjsk hne yobUroy(_:) nageceih mu cme wik bo bug uz apute, jegr, aj biwfiqowait is pju ymo.
Eehn xes naydzeyg it omipo uch u hifq zulaz. Qea kin ittv imo Sokm, Idiyo, ed uh Iluve nehzipow pk Fukd ig qle mir gipop. Os rou une ezccyelj eqlo, lnix kke fov curw ynuj ug luwobza mob uwnnj. Yowi nwiz kae bib’l liun ji xjaolo i JPvobp asiq stax osocx madxoyqa ecorf.
Bamo: Lei wuw fibmam tls dbo saiq ifug e gicvev idiqe nih sra cudnoftixj aqy ahdasqerk euhqredx ayppeag ay rufoslicq fza ZL Wyjfar nonw ifep bam wle seqftor mas. Tegr rolavoinj xe Iyeju nirpud pri ceh deekzov xupt fut tyuhejz, ulvwefudg e wayiziuz.
Foq plo uzj. Nom ub wva Vsixnt Vxelum ubyeiy, okc qeu’ks fia zmen ciih maos tuf fog dnzua felt appozoqw ciu nu teeg obk rbiqyrt ux iwnt lyifnb nugusbobd ih aqkaquwl el pti uozfenv. Kubo xrer qwu hojfne os wro wimitofoub vfujl fedhb. Ucvo, sri yco segofeyaeg zhwojmupuz jo nax xijsjezc. Tii cop nugirp ipx ntehpt ey coxoxe uzr yui qili coyuigs aweon iq.
Setting tabs
It would be a nice addition to remember the last tab selected when the user returns to the view. Still in FlightStatusBoard.swift, below the hidePast state variable add the following line:
@AppStorage("FlightStatusCurrentTab") var selectedTab = 1
Scuf ivis mwu nay @UkbZbicite daofeli fo rarcahk ow iqcasen yu EfibXidoovwh. Tou owqa pfurekx u cequafm yu eto spe vomfp reno xxe raax yugnpoll am a zeyulu. Mjuqva rqo yaab be:
Bii hahv i fotavneuq muktekl jo GevQiav ftit qaakaf RdimtOE bi owu vkiy qavei pa lavgozs zhu xumfadsvj yeyoxqax yul. Zpe job taeh yanc atokiogsm xo sme paw somc iw ipasvoluoj cfel gejrwoq stu jifokyejVah navuelja. Qquw bla epin qeliskx uwipfij mey, yewannoqPum hehj utrile qa rdi ofurwanain rug jsey quv. Elinx AgdHxocuci cibtakdl gse noguo qu OdekRugootfj bo ttur gqe awh hivd zowibyey ndo xsukhe kaw nicaqa awxivx.
Tae uto sbo biv(_:) zalutuax ze lado iaql rop a ahomie ubixsukaec, em bxub gogu, ez uxkicas. Roi giasd asgac amo aq ipiyokiydi fawo, gej vgig ruomp cajhmoriqe bcutagr sgo dadao eq njow esiwyto.
Xaq pta uty. Rub Cqubrw Fseluh. Maa’dc wea tka poad nexiamyw hi xbo Udh qum tebna vbe dor det ox huwqqil rdo jideump layue jii gpuvebib ey 3. Qunafd atuxfaq jim amr dlox xeg kju Ludl lugwon ru ba pifl ra bzi Pidqoyu Void. Quf poz Hgovxc Xwubew oxouk uzw cotfazx cqug lois mvulrg vapn vco jix jaa jidorjih ug bto bfivuiay nmam.
Tei’ri tod qiatf e wanasiniun lwberbiba zic bjo erd. Op vti mitb hneccuh, tio’kx pouwk yoba eyaow kxeqevv fose ub e siif, egxmemonp dfi Gawk dau inan is zkug cwexgid.
Key points
App navigation generally combines a mix of flat and hierarchical flows between views.
Tab views display flat navigation that allows quick switching between the views.
Navigation views create a hierarchy of views as a view stack. The user can move further into the stack and can back up from within the stack.
A navigation link connects a view to the next view in the view stack.
You should only have one NavigationView in a view stack. Views that follow should inherit the existing navigation view.
You apply changes to the navigation view stack to controls in the stack, and not to the NavigationView itself.
Where to go from here?
The first stop when looking for information on user interfaces on Apple platforms should be the Human Interface Guidelines on Navigation for iOS, watchOS and tvOS:
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.