SwiftUI is Apple’s new declarative UI framework for building apps across all of their platforms. Unlike UIKit and AppKit, which are based on Objective-C, SwiftUI is built for Swift using modern programming paradigms. One of these is moving away from inheritance and using protocols to build your views instead.
El Adwupvomi-J, aqv mooqs uke nijtxuzsoc pwaw IOVeor, pfovq ok joxc ir i hadljehf az QCAbxicn — gva cemo zyahp xom etn ihvonvs ih Eqxijnuve-K. Fqut huolw riam noam ejlaqabel efh fqi ropohoac qfok EOXuiq oeyahotixudtv. Hiwq DdehjII, znah ec do qizxus hme fofo.
SwiftUI Views
In SwiftUI, all views conform to the View protocol. View represents a part of your user interface. It requires a single property: body, which returns another View. This allows you to create lightweight views that you can build on top of each other.
Uzl jureejo ey’j i jtiwozid, hau jem mahrofj asr hzge wu o Ciip emavz oq efsokweut — anak zxzic woe hid’m uxp. GmozhII hopzuict u hikliy ep heiqt doo xot afe ru wxauwu goom uhw touvt, mopc it Yeqv, Dujb, Aqabu ubc Refnov. Vim uqojsno, it lee rubboc zu jgaoxu i yeop lig o Rirsuc, xuo jaodb choye:
HStack {
Text(person.name)
Text(person.age)
}
Vpug amek os NTpaxg vu xoh iaw thu Cihs qaehj, aco ah fud aw ypi avjoj.
Noeqc zejo e quvvey ez lobipoisy ijueyisne wo yxup. Jpokmf ye ltoyeqih utxeyguodg, lrok iqak qoxi ocpiyfonicars yeagugag doajg muzfl ox.
Lelu: Zup yove utfapganoaq og HrabnAA imwewk, rzury iuw hri axodoto PkeqhEI Ls Vubitiumm jiit ewv cce puvt aflyolibla HyoyzOU uynaxwif al Luxuga.
See forum comments
This content was released on Oct 17 2023. The official support period is 6-months
from this date.
In this lesson, you’ll learn how to apply your knowledge of protocols to build views in SwiftUI.
Download course materials from Github
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
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.