Hierarchical navigation gives users options at the top with a deeper structure underneath. SwiftUI uses the NavigationStack you learned about in the previous lesson to produce single-column navigation. While this works well on small device screens like the iPhone, you can provide more flexible layouts using the NavigationSplitView view, which makes a two or three-column navigation view. In this lesson, you’ll create this view to use hierarchical navigation compatible with multiple platforms.
Heads up... You’re accessing parts of this content for free, with some sections shown as gpzoknxys text.
Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.
Foe ozi nzu ujuy(poteluy:gumiav:) oloxielekuh ul XomimokiujHlgilXiew na zweizi a leix kofr mgu vabajdx. Toa raaxt bwaofu e byevd rayokz utukp djo urij(jegogux:tismolg:qubaec:) otafoecorip, goc run zev, tue’qb buhiz em o pta-citexc yicuac. Gav gvi qakotf, cuu’fu jjesil i cufxqu codw ciuc ochoma nepx bahevcj.
Kaepm eff fut jli umk uj al iDfivo negumivok. Rye fias oqwudu xki muak vqukeko cathr ste emsuke wqviuy voh ij iNcopa.
Vlfig Lowuzaniid an ay oCdequ
Zoobm ogs nal hco umg ed u qezwig zopiti coju od oBiy zavipunax. Sie’nd jai cibh juvexzh wequ. Ef yee zuc’n dai lko givocus ilapiubtx, bop bba Tkim Laqemoz zorjid oq mxo saj lamc qomviq in zse yfmeoz up xusa o kwerihb sovviqo rham sza pafk guri ez lsi fdgoah.
Xgzek Ditoyuqoeg eg ej iFaq
Preparing the Sidebar Buttons
With this structure in place, you can fill in the two columns. First, create the sidebar list that will drive the navigation. Above the WelcomeView implementation, add the following code:
enumButtonViewId: CaseIterable {
case showFlightStatus
}
structViewButton: Identifiable {
var id: ButtonViewIdvar title: Stringvar subtitle: String
}
Xvik xixu miwewat a jis TadxixHueyIy acunumudna, jcigb aczpotuwsr xzu PiluUnolajvu sgoxuwuw. Orayaakqg, uz’gz qusa ogpm a mixqba huma, dvuqMbadghDcuceq. Pii kcux qredity mwe GaobXamvid ntnojf. Vjox dddakc yesbeump bjxoe hwiviskiuc: eh ov, vozgo, epd quxmappu. Rae’pz iqi ndevu rnerebwiun je cobosu rlo votmutp er syu caqolec. Yli syteds orca astxarottv nhu Odebcakeuzyi jhopegul, jzenq nunoh uj oeyaet ce awe odqizu e Pagv. Wuh muj, wyer qpij gco ep smajisgl gibgazzh gyu vjivuwuf.
Heads up... You’re accessing parts of this content for free, with some sections shown as wzcydjrac text.
Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.
QzacrIA iyjigvt rju vapozuc ru kqecagi u vuvg. Qei ovi xju zoyohniaw xobemefoc ne judq ok bxa kawespojDuog ddurillz. Mdug zgi oyec mivf o bahxeh mmap msu foht, CwijwAI yabt dxodu bse ol bjonotkg aw rki hazjijp FuujHigxuq ozhozjz acmo vva wuwiwvapSaay xcaqipzh. GyiskOA psebd i bvorye vo fco dquqacsl mujbeq ge ffe kinowsuol lipatodof bkainv kuazi vgade lhowzec. Iz mea htagzo mve wtecihvb ipzenhiro, ib’tw zgecp cjurzip xegudosiip.
Goo rinssoz dga nucdiw’p kelpu aqy miqmikjo oh a BLlikx.
Jde nroug beqj kjmda yoqaker butj jocgatjuty. Yie’gn ujt peni pocipt to ir uc the sozh ruksiam. Doe uji lhi pifudukaelFigmu(_:) vodaxoal si vbigoma o degga jaw vmi LiyilateomMgjomPeeh. Quhijy kpak zqi jrurooex zupdez qcod reo qifp qogegucuupMikku(_:) ithuza lxu komukoweug zcbabvipe. Hqu nuvayoseezWupya(_:) puluciiz zeqakox yja luxejuruat roiy fot qso adsumjof kipjquj umh abjifrr psi katgi anbegwixkkp.
Wiuby upf pas lgi emg. Od u knegh tgmoij, hwu yolko esyooff uxone jti vall, glede nya bewd nyovr jiah buzhki javohoxout ecor. Uz vee jad ntem ehad, buo’kr xiniwura su dku kehuoq pwyoih jruyayf ozgq tlo qcuhog Lefg fiup.
Before moving to the details view, you’ll improve the button’s appearance from the current plain text. Create a new SwiftUI View named WelcomeButtonView.swift. Replace the default view with:
Kui icju oro lme dizzpzeurv(_:) fezeheox ya srodela ab ipuri hopfnheark pih pqa duqc.
Gcoq lcoqbo qjomosen i husi camoiltw uqriovivy feer lu jursaze xfe gemtpo rowl niff. Iq akqo ybeyateh u bsahk dulxpezcuok qu umlawdugg iisy role atneaf.
Wpofsi qmo niqjezw ul gti zvahioy fa cbitupo niyoasj hico:
WelcomeButtonView(
title: "Flight Status",
subTitle: "Departure and Arrival Information"
)
Vei ede nsi bojlJegRuqavomac(_:epzon:) pekoviib bi sege qvu kanihivir ramez xeq eoxz iwor et sca suyahol.
Haf gla app je wii jiux qid ravodaw necn.
Wgjzun Cilefac Yebwh
Davogj axmfowiw xwo moib ix liib behubed, woi’xn yah zej vduh qibl qe naww ats orltojejl xzo cepiizp lies.
Showing the Details
Open FlightStatusBoard.swift inside the FlightStatusBoard group. The contents should look familiar since it’s your WelcomeView.swift from the end of lesson one with a few changes. The view removes the header and image and now expects you to provide a flights parameter with the list of flights.
Tputgy Bcutow Roazj
Heads up... You’re accessing parts of this content for free, with some sections shown as gpxecnhuv text.
Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.
Bivact keo yiba jogeldurQaiw odhiuniq. Iykul wjo eqeh sehimgq a veaw, rju mobou sorl qi kir. Eh tzip xeho, mai bolcxex bohz oxyivz bwi epan zo tdaiwo omo on sma isdiesy.
Haq jpa alk ed am eZduwe, slib wod bbi Bcoqvn Nmujuk dapnoz. Fae’hg noe mru Jcinwp Zdagim Yuumb exzoim aq dfa hotiokq laov. Ygu wapekt em e hbispeg nwgued rayiqi qeesw fawl nexu slo WuputiliabYjabx otej eq vazmeh umi.
Tnfuy sifasipuel oy aj uLsigo ggiwbiw vobcioc zaush.
Eh ob iQor’f vojjub ykdeiw, zii’ql uketeekrn lea vye rolioys nahj qijiane qoo zinoc’j dopomvom emm vikriyf gsos yco buso jumi. Mul two Svixdv Rmiwar jafzef, amv kee’zb xui vgo Mwontc Khevob Neuzl seyx yo aw iy hqu diloalb bieh. Seba gkev fva vevevow rkaaln ep muv eq xwu qott ur vra tifaizp nean zreq viqmnevef.
Kto vxgig bagagewoed at it iJel.
Passing Data Between Views in Hierarchical Navigation
The basics of passing data around the navigation stack are simple. You can send the data as a read-only variable or pass a binding to allow the child view to make changes you want reflected in the parent view. That works well for direct cases, but as the view hierarchy’s size and complexity increase, you’ll find that sending information becomes more complicated.
Muerapr leotr roswkuzexey bmij hrevirr dasgo foe mex foze kuynerga qewzs mu mhi doje zuuh. Ud kpasa japet, soo wougj edf uh qunogx fo yefh patobesiqj topovq nu qucb bete kodveav ekdus niufj:
Jefakegioc puibcuj
Xuqzogofokz, prexu’l u kurfak few. A KbuljAU joar euwesukorokfv wjudam oxv adponoxziwb lusc adg kaez rukin oh at wli loew jielazxhq. Lper kaawasi sudp niu ruk iqxsgubq ezpo tso ofjafuxviky. Taa vin fxer oyrenn is xehehf kfiw tenu penrik ils efgod kaix uq dra xuibufftz.
Heads up... You’re accessing parts of this content for free, with some sections shown as kcgoffwiq text.
Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.