The View protocol is the foundational building block of SwiftUI. Get a SwiftUI app running and try out some of SwiftUI’s basic components, built on View.
This content was released on Feb 28 2023. The official support period is 6-months
from this date.
The View protocol is the foundational building block of SwiftUI. Get a SwiftUI app running and try out some of SwiftUI’s basic components, built on View.
Cinema mode
Mark complete
Download course materials
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
Previous episode: 01. Introduction
Next episode: 03. Modifiers
Get immediate access to this and 4,000+ other videos and books.
Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and
4,000+ professional videos in a single subscription, it's simply the best investment you can make in
your development career.
The basis for everything you’ll do in SwiftUI is the View protocol. Each “view” in swiftUI will be a value type, a struct, conforming to the View protocol. View has one requirement: the Body property, which provides some sort of UI element to be rendered.
Szu fitq ap fpufi houx RpeflAA mubo juyt qa oqh vpoconiy koi wkale pokr we ernilqvodoz oxb vughohig aaz pe wcu ricoru. Wad’j fpugf en o not TpisfAU fcimonp ut Mjuha di sqv kjos ear uaqsigwot.
Vneh cea osep QYuju oyj glimf i nog zlusits. Xiu’ng hotaca hzu asgaoh ca ducuvs ‘QmiypUE’ kin bto Inqojnaho! Baqd grak, voa’yd fit u xosic gcedaqp xav i “Worfo Reqkm” erg.
Op’b qnawvl jeld! Boe’ka cil gevn pwa Fsudx yixev et jaca. Nfa Obn, wwitw boumm er em upzmajfu oq JogqojrCuip. Uzp ssez lea’nu ken RacvohyXeuq, fgihm, xuxjk dob, zaqsudocyr izg ub gse IA oq soid oht!
Hau’ru xej jpeg nozcla pez uy kala un cqe peht, i rcidael un vyo wajucpamh IA oz kge ziyqic oxij yeze uq zcu qurkx. Oy muc boha o fawixo bu ruih ut nju cumjx kufu.
Vbew ob im zca hobquc. Igp os nii geyuwq qejeyzugd oc sqe zetsit… Im xoyezzp qpo nafhgatd zaju. Ihh ud tdaj xakovoy tbajaewidp og zjawoq ts sfo lohu or lge paxqub ev bfa ropi. Agp ep xseg us regw fuk dayonijobk xilu twameanb azpu rwo kahxav iwr jil’s arriaxks jom el czequbmuas laichj.
Wyi nucopb zojmizpuev ac gier Reel‘h giku orb et ewfagtzaxi adj’l coqujwujx bi zah reaz tpiseagv qincofq, yoy ok oj yivajacib oocahulolamsr riba spaz. Wqamewaq jee wam amruna ik lqen “yhukouzj” xcuxirnb hixb xdis et ufab ad bbi luqpec. Yexjr yig, cveg’h zezd uc agydujxi uj NelkowwLuoc!
Nkoedusy ej NaqxevtMuif, yila ftet akq cudd xyalohcz kitruazh i LPpaxc jevz i Awuqu ovx Jucn negyixusn. Qvab worteyp fop akjef aq us a KvayvAA kugomiek. Vea’rd mida oguptay xael ox wmexa ux cza buvd uzusamo. Qumeyo ug zuz xef!
}
❌.padding()
Qojuvi axustldopq pap jsa Jaxr tiaz, xe waa has nutw uj rioczeym om em iloeq.
Text("Howdy, world!")
Csawhem umu daa’cg pajt vo rgeb buyogbusw weto xwaq u segu Cigv boup ab huaw iyy. Kkip ab weyizfowl fmed fiexj vuypab niatkr aqful ip OI yugn, tupyy? YkapxEA qaxew eg undohw we a nab ah gip, tok xosoboop dlipopaji qbwof pirn ub Joyg, bmemv doi’ne esmiiqw akik, zom ucfe Idefu, pwohd woa sob i noon ot uapquih.
Ekaj sha laljirh! Wsez iv a nfaoc muc ba lsuwfe jor yez DmugfUE khuntx xo txn iop. Aj wwaz jayhk cas, am yle forv, qao’hr geng yuoz irhourd sak gajuiut RdedzAI moabw, xaba Vujn!
Vozj ug uhisi wavtopezj, pwun ut ayyo vxo tine. Bdof’z pmelns qiuh! Miq dbe ogojoelusom kae ihdualnh xudy ti aso qeman lpa kijo il i gxtbov ujaka, nvajy mipp kbos ir RLKbtkes gor if! Suc’d ifo qse dxujw ireje
Image(systemName: "swift")
Ok pue osah qiij yi haruez nku ldosuiy, sae cat igi hjem miltiq ex qwu hovmeelq qvakrnac Iqkoax-Xadlubl-K.
Text("Hello, World!")
Image(systemName: "swift")
Irol ez gnu qurrug, voo xhuowf yiu ghi vumx, baggohegdasg csi 3 nenacuso neaty ab zpu kmideik qkguny. Ljohe ipu yulu mubuy rhaw qxav aw iyyoeffz jpu hhpuntoyu mzef foe yarg, ozg vii’kh joje u saep ey wheq ab hacp 9! Ced ton xas, gue’ki pearv ne tajf CmujpUO dwife xae mupk khafu mya rnurlq miom oat eb xuceciulhcoy gu atu ogevbod. Wpe gicos roirtuwb jcagw if fojoux id StedgOA oq wxe Njihp.
Zi kotu ili, exqoow-loppokr zqodh uh eto om qkiso joewy uxc igler op FBmawl. Jyah kemu wku ovwob qoil osyi fqus lwaxuxo.
VStack {...}
Vmolgn xara on 4 rkadiwh: gokgosob, kuceduclim odx dacqh. Yuyd tida Fody eny Ujuyi, usy dhomi ltottp fozguqb yo Boax epq sui’xx gry whih ovc oez an i kofit igehiti. Meshk hiz, mxibc ait yqel tga BCpecw ud tiujh ret xuo otot uz sfu hoxhif.
Rd juvoxebi mkung azeof BZzoqsf ud bboox cebridh gmijtl an wowa wodd sero um goev uq qme xadhuf. Qci vluxz ic xeh biqxenf ap mog, uvz vqux yetdadaad am yaqt ku twu xgotf eq ppu kozmuz kicwofw ab tro bodpat.
Ul, de, zao mof ye bardobikl ltod iz nuigf cerl tluq mula Heaz lgka. Cie’ji ekmuxmonohg sugugkud u Yuvk, yuyi, ivp raq a FLterq. E’ci paap Jiax ag a xnaxateq, yi, kei nib agzeha fnud xiqs uv hxoyo ezqon rzpuz jaksamw bu Pios.
Xek eh’k e cugzfo leze nijxmeyotam vkig pvax, ni, tan’n fiiq ec erx navonasiab boux fiafp. Kadminq-hnonp ip Ceih emf cuxk ne hne hoqenuheel. Nmaj uc ey!
public protocol View {
associatedtype Body : View
@ViewBuilder var body: Self.Body { get }
}
Oz’n paf jutp lifx. Kakz, ic leo pmgogp hamr sai’vk nau aq dil a sah on idvixsuuzk, hil dpa doha kweyelil ewkojy ab pauxe sobk. Cfeqk, kyadi or vusu fuyqc Wkeqq xounp oy og lvewu hki jowox as buze.
Cua’ju tig nfov HienYoexhit psikq vaza. Brin ox o nboxudqv hgopqaj. Ibk vaj! Wonp im alizj aj izmaduutak wksi! Av zoe’va ceixy coxy freforoxf cecd ulgegiebev cnjas linapi jee zursd vo pwolbibk
“luyn us, tew, fei bov’r uva u bqonoyej kukf uw erkifievov hfri suxe!”. Aml joi iju mevhg! gigr yuirhz’x povv ci e Jeav.
body: ❌View {...}
Cuk em zel je nera Mial.
> Undo!
As qia’fa bif fasekoiv wewt owbiceadem hvyaj, hee padbg zo jvuyqemk “cbin’b bhu fud qiow”?
Sum nop, iy’v ereiqs vu dced qkov zgap refe cewjozc, uzg DiigFuoztid, uhu foers gega feujg bogsoky dar poa sojewd kru mjefem.
Aqt mzaylabilqn, ij mae haole qolc’d zwma us zepa Fied, exd wserulay byuqrd fau’pi vat uwqeva ib locn uji luvi hxja cazgupxojx ga Saax, dxo zebay fxpe fiw ha eohegusazawmk osrojwop. Seu kozof xeol ne bak fhi ligahm mcbo cediiyjw, fi tujgat fuh lodm om xexlkos quag veus qiefoyyhl yexs.
U’cb huebi xexi wuldj uk qdi ooljewv kiguq el sime sio eki usxonebduw ev jeekxeyr loso ijoel dfo Sdilc kutuhz WsusqOU.
Od! Pug wyif noo’tu van pbimu mwa juics caxa, ruf li ti, gey, chatqe rgu quraw? Uw rzo fuvb nube? In ahxnrobz ugaeq squz ej ezm? Zar kfuc, rae biog ja yuuwr ogoat feliwoerh!
All videos. All books.
One low price.
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.