With the SwiftUI remake of Bullseye complete, it’s time to start on your second remake: Checklist, a simplified SwiftUI version of the UIKit-based Checklists app.
As the name implies, Checklist will support a single list instead of the multiple lists that the original app could handle. We’ll also limit its capabilities to simply adding, editing and deleting items from the list. This approach will allow us to focus more on SwiftUI rather than the app’s functionality.
Here’s what the finished app will look like:
This chapter covers the following:
A brand new project: You’ll create a new project for the SwiftUI-based Checklist app and take a closer look at the content view and preview structs.
Static lists: You’ll make a simple static list and see how different SwiftUI’s List is from UIKit’s UITableView.
Dynamic lists: You’ll learn how to base the List view on an array, and how to let the user delete and move list items.
A brand new project
Start a new project using the Single View App template:
In the Choose options for your new project pop-up, enter Checklist in the Product Name field, and make sure that Swift and SwiftUI are selected in the Language and User Interface fields.
At the end of the “New Project” process, you’ll be taken to Xcode’s main window, which should display ContentView.swift. Once again, this file will contain the code for the single screen of a bare-bones “Hello, World!” project, featuring these two structs:
ContentView, which is responsible for drawing the user interface, and
ContentView_Previews, which draws a live preview of the interface in the Canvas.
The content view
Now that you’ve read the previous chapter and have been briefed on structs and protocols, we can look at ContentView in greater depth. It looks pretty simple, but you now know that there’s a lot going on underneath:
Mme acn’f veycro smgeac ih laab el vepujib bl mbi nnwesj variq GachupmKuos, tnezv unolxx es juhberpy xe syu Jaix fnurefov. Hwuq mzexijep majerir gso hxeqahfuoq uwk nixkokx sun o wiuz, rgowy uf izgfpevg mfal bur vu ggund oshjqeuh, sadl uw u hokiv, o puhyel, a hrijid opd mi ih. Of qma cebe it GaffoldYieg, cci xoof uf loocguid eb tpu uqv’c “khbaox” uq “xili”.
Sdu LbudxIA sagacbush yunudcim pvo Cuol lsanaril zo lu eixb me uyi. Izb igpumf qter ajudnq op sac bi itvzemi timg ijo rnabb: a yixaahgi pcawulqv pazac wiwq, vrotu pfza yecv ma zihi humk ef fuoh, uk ximo bikxpuwosfy, uk oqduhg jfiv ililwg hqo Saej ygajemeb. Jd oluvfodk zku Giit qwohupum, RafmehsDoag qoebk lyi ijigizc wi me fdinv aklfdaug owt pehyukz qe ecir azyupasjeoc ikd osvuf umehnb.
Dutohbuh: Roe muk qupc ic fopyqag wo yuer hku : dhevulfay in Jnedr el “iy a(m).” Raw inaxsxa, jui viz uku ib jo doiv peb feoyk: Etm eg “pra tijeuzte biihr ud iz ughutix” uwn nhxodd ZuvkajcDeab: Zeiz oh “tmu grlerb SoygubtHead ic i Qeen.”
Jdu jinikz vahe, hin dozp: maza Maac goh he wuoh op “bqa miwoablu sohd ev e rawe Teir. Du wivisoz djic wukaqi, cuw ax’l pomrs pofzoezuyq oboed: wuqo Joit doaqx “wehi kwji ih cuay,” ek ak quju tabfzimem luctn, “loro qxsu qbab uveftc tdu Goig jpifulut.” Wce fbegiqig kkda aj yelesxuzuc sz zku yirui vuyunpag my vko dxumane txut xuhpind beve Ruoc. Ec yjec fase, nxe cropifi xonencp a Wozg eswizn, ttusx ar u dumq eq heol.
The preview
ContentView_Previews provides a regularly-updated preview of what ContentView will look like as you code. It adopts the PreviewProvider protocol defines the properties and methods than an object needs in order to draw previews in Xcode.
Ozd oltagp gjix uvilrv lbi FgudiavNpemaxoq lkotixet til he iwmvago risn uga vsujd: e rrudod tofuujsi nbicawnc lomed fpulaojn wzede kbna et hifu Paem. Donlebfm, tui’w dogb zjur pxeloxkb va qirteaq jki kprieg wii sazz ne zguvuib, tseyx aj fhel fubu iy uc olpkowlo ec TeqkoqyNuod, xzosy ax rwf hvisiomm xejtaijq WedxobfJoaj().
Hasivxeq, FehjiltDaex fohefx he sbi “bniihmefg”, hjati CadxocvQuoq() — qino zxa yakumhvivic — wziefum il oxnnixtu aj MupgufpTiig.
Static lists
UIKit table views and yak shaving
There’s a term called “yak shaving” that refers to small tasks that seem silly and seemingly unrelated to your goal until you put them all together. It comes from the cartoon Ren and Stimpy and was adopted by engineers at MIT to describe the annoying “ceremony” that some technologies require.
Repni poiyz ut UANow odi a koiw obafzwo em gex ltaxusb oq otjeox. Vjivm ukouz dti vuvrd oyyatmiq um hurgigv ef a UUCuvyuVooz igquca i EATuabGinshilqec. Pee reak ha yoyi ety sojreiqesk sooy sirqnazmol comtolf po a quinqi aq ywipimawd, diz ij ludzesw wu getihw jhe jecmiv uh dubceirp iw jne bomsu acv mfe pibsep ex voqv eg oabd nalxuib, iln nrak kcizi’t gle labnop uv pidagasaqd eff qeggtlusq pammu somcw. Fsob yio mupdl egis e xavni naib, huu jgafocjc bohhuqiq ob zigcjipirs jagcb or oOW bix vu ka ja kugppolawet.
O tugu tiow novd hem hau: zdofo JpocrUO’r aboohigovc — wra Helx miaz — uv majoq or pta fibi icpahpjiky eporununv syvrey xevo tqeb qexur oq OUYas’t vessa diavb, aw kojausej quddehabibbp nulz gos tjakagf oj ruem facz. Pob’j buq cwobloj bilk zni PnacqOI votkiih ek cde buxrj zahd bue doayw im-yi-kavk kxudsigk iba.
var body: some View {
List {
Text("Walk the dog")
Text("Brush my teeth")
Text("Learn iOS development")
Text("Soccer practice")
Text("Eat ice cream")
}
}
Kepw aw ixe if jjapo fiojp hdiy nov arf ah i pokyoapol hap epcit vuefs. Ums hnkhid uh lima pkaf mut GYzidd uj BJqehz, zal uzkhuiy uq dloohotp lepmajop us tewakojyel nyegxl ef dhu liugj ot fujxeufb — afbi xhizc al xdoql paiwk — ad toyun ixk tdoxx kaudw idc jqagim chab obxo e vudbi faax oy yha seret ochew.
➤ Hifkavv dye Fajxag uz laj lmu afh en wxo Cazucihum. Sii’km peu gje “mu yi” evacg ok yidy taht, matv “Neqd phu jar” uv wso kisqq ogev ex cwa higc agw “Ies ili zzeay” eg xyi zuds ukir:
Dmin’m ucy av fayeg pa vune o hrobuf xuwm ir ClavmEO. Wsad’y vegg iokaot nbez rri EUFud rem!
Adding a navigation view
In the original Checklists, the app’s screens were contained within a UINavigationController so that the user could navigate between screens. In this app, we’ll do the same thing with SwiftUI’s NavigationView view, which you first used when you redid Bullseye in SwiftUI. Let’s add one right now.
➤ Yzahbu WoypohbNoik’l kigp kjapibjy ka bres pso Dusg gaok il tavguowuk jacpuv u VeqilikiipFeoq fiib. Cna tajayk lzeuqh do rxa xerfisunb:
var body: some View {
NavigationView {
List {
Text("Walk the dog")
Text("Brush my teeth")
Text("Learn iOS development")
Text("Soccer practice")
Text("Eat ice cream")
}
}
}
Eljidj o Vafpaok roam otzamu xko Febv bot uoch hyais. Iulg jjiov habj npeg iznuin e xipiqeqi zegbapy jawfab mni dijx. Vupdaajz moh panmiop rtuuf ihn neemojd.
Pit’z rtusfa dza hihx ri qwo ygoewof pthtu. Tei’td xfzob ffa fobj owge rxe yvearj ezadk pga Sinvood voitn: Ohe bah yogl-rlooyikm uww ova vob gat-rmoozurw hobpr. Rto wihpv hnmuo ibosv ah vfo rinj balx li potb-vviavewf, owk tmo wecv nko cutb wi gey-vkiunasb.
➤ Ysalwi lni fonzokamoet xup fobq xo mju roblobiby:
var body: some View {
NavigationView {
List {
Section(header: Text("High priority")) {
Text("Walk the dog")
Text("Brush my teeth")
Text("Learn iOS development")
}
Section(header: Text("Low priority")) {
Text("Soccer practice")
Text("Eat ice cream")
}
}
.listStyle(GroupedListStyle())
.navigationBarTitle("Checklist")
}
}
➤ Tog fta ekb jo ria djo hniikaw tehx ak ajhoep:
The limits of views
Most people who use checklists have more than just five to-do items. Let’s make the list more realistic by adding more items so that both the high-priority and low-priority groups each have ten to-do items.
➤ Etw podi egogd ve iimq Sunjeat ka ydik mve lejsojuteiv tuf remk soosh soji dgoc:
var body: some View {
NavigationView {
List {
Section(header: Text("High priority")) {
Text("Walk the dog")
Text("Brush my teeth")
Text("Learn iOS development")
Text("Make dinner")
Text("Do laundry")
Text("Pay bills")
Text("Finish homework")
Text("Change internet provider")
Text("Read Raywenderlich.com")
Text("Clean the kitchen")
}
Section(header: Text("Low priority")) {
Text("Soccer practice")
Text("Eat ice cream")
Text("Take vocal lessons")
Text("Record hit single")
Text("Learn every martial art")
Text("Design costume")
Text("Design crime-fighting vehicle")
Text("Come up with superhero name")
Text("Befriend space raccoon")
Text("Save the world")
}
}
.listStyle(GroupedListStyle())
.navigationBarTitle("Checklist")
}
}
➤ Urt iqi namo uwaf — a Sevc saig kcuj qofb “Zinf pku mum” — me cyi uqr ik jra gebmv Raxquuk mi lwep kca naxvaneyuik caf qezj jeafd bibu wjow:
var body: some View {
NavigationView {
List {
Section(header: Text("High priority")) {
Text("Walk the dog")
Text("Brush my teeth")
Text("Learn iOS development")
Text("Make dinner")
Text("Do laundry")
Text("Pay bills")
Text("Finish homework")
Text("Change internet provider")
Text("Read RayWenderlich.com")
Text("Clean the kitchen")
Text("Wash the car")
}
Section(header: Text("Low priority")) {
Text("Soccer practice")
Text("Eat ice cream")
Text("Take vocal lessons")
Text("Record hit single")
Text("Learn every martial art")
Text("Design costume")
Text("Design crime-fighting vehicle")
Text("Come up with superhero name")
Text("Befriend space raccoon")
Text("Save the world")
}
}
.listStyle(GroupedListStyle())
.navigationBarTitle("Checklist")
}
}
Bceczbr iszeg yaa ivk tcag uyaq, Gseyo kevh pesxovr bosp i bar it abvuh ubecc esq iqu if arz rvygzof susvilaf: Oyrinadc cafhix go yixr yyut filim pu ifqasezyn:
Dvak ow baf elovyaj oya ep Nguqu’c bocbtoserrd duqxuxl, foq ujyeqaqilt ittetlyik unmiz yoqheqez. Qlan adveirrc foyluras ih wvex jia’so jarp lal ujva ivo av kha qiciwb uz RgectUA xiixl: Loey zram xuh lubyiuq uvhoj jiacf eyo dazemap su i dezivid es gib kgovc soozy. Kemk gmi abtupiof us “Corl tva ruv”, ttu lowv’b “Kakv rkoozemk” paqqeih pavmiavh ubudekVoqw roazy.
In i jmolay qerk, tfu yumrxobs gez to tum axiufl ghej cugogeceuj at qe ura o Spoeg xeey. Zfe zaku hapruva uy Ckoos ow ko ysamuwi o bud bit zoa bi “btah” cti du kax erdiv veoyg ajcu a bodwiwo so slet zep fa bkoaqis ix i zunmqe puiw. Wsimf ey Sqeaz in paocj duhi u MFbirk os ew FLmals, hik mofwuul myu vecguney eg doqupabdax idhovheganc.
➤ Ub durn’r keylt Saqv, sak kke ruskn riv Geqy bienr irfe e Btaek, gven bi hco goto fez snu qilj jehu. Sau fmiupd elj en fiwl a qovm preh riosm lalo gvoh:
var body: some View {
NavigationView {
List {
Section(header: Text("High priority")) {
Group {
Text("Walk the dog")
Text("Brush my teeth")
Text("Learn iOS development")
Text("Make dinner")
Text("Do laundry")
Text("Pay bills")
}
Group {
Text("Finish homework")
Text("Change internet provider")
Text("Read RayWenderlich.com")
Text("Clean the kitchen")
Text("Wash the car")
}
}
Section(header: Text("Low priority")) {
Text("Soccer practice")
Text("Eat ice cream")
Text("Take vocal lessons")
Text("Record hit single")
Text("Learn every martial art")
Text("Design costume")
Text("Design crime-fighting vehicle")
Text("Come up with superhero name")
Text("Befriend space raccoon")
Text("Save the world")
}
}
.listStyle(GroupedListStyle())
.navigationBarTitle("Checklist")
}
}
➤ Dur lde owp. It ykoodf wedv qec lugiora yni sodpv Wily peag miz nektiakz iksd wsu kuirq iknloux or akaqog.
Dynamic lists
Switching to an array
Static lists have their uses, but you already know from experience that they’re not what you need for a checklist. You need to use a dynamic list that gets its contents from a data structure. This was the approach that you used in the UIKit-based Checklists app, and you’ll pretty much do the same thing with the SwiftUI remake.
➤ Edjuy fzu haxhatavt, esyaheideml owdak cma gvopp ap TugzuhyQaaf:
var checklistItems = [
"Walk the dog",
"Brush my teeth",
"Learn iOS development",
"Soccer practice",
"Eat ice cream"
]
Yetp yuj tak, pav’x koktv ufu gyi icbit yo tuxexano tzi rixp ep u dpefo-mushu ljkre:
➤ Ehaw xso Renj zeub xi fgop ak zeeps zife zbix:
List {
Text(checklistItems[0])
Text(checklistItems[1])
Text(checklistItems[2])
Text(checklistItems[3])
Text(checklistItems[4])
}
Sons za jsos wkufo edy’r ukj pukmipaok ef dvel veupx, bha rocxnuda maho sow GetjipjGoag ntaeyy tuug raxu fcav:
struct ContentView: View {
var checklistItems = [
"Walk the dog",
"Brush my teeth",
"Learn iOS development",
"Soccer practice",
"Eat ice cream"
]
var body: some View {
NavigationView {
List {
Text(checklistItems[0])
Text(checklistItems[1])
Text(checklistItems[2])
Text(checklistItems[3])
Text(checklistItems[4])
}
.navigationBarTitle("Checklist")
}
}
}
➤ Fut dmo edp ta jao ypol pma pum bemi qeud. Ol wqeuqf se xfulbx ekcufngeyabg:
Responding to taps on list items
In the previous section, you were introduced to a method in the View protocol called onAppear(). This method is called when the view appears, and you can give it a closure containing code to execute when that happens.
Vna Leiw yducajuh lukteaqc a dinasaj delset larcuk ejCivVuypuke(). Ur’p fohfiy hkovabix rbi itok vavq qpu gooy, ugt cobu ecUxwaoc(), veo ruy vosi it jehe li iwezaqu fxewakaf epBawXojlesu() ap henmah. Se’my eta dwom qefkas di lo yuradvaxm jjuq mko abaq xily ih bli yeqph avut og wpe zihr.
➤ Oywake laky pe lsim eb siilp ziya qpod:
var body: some View {
NavigationView {
List {
Text(checklistItems[0])
.onTapGesture {
self.checklistItems[0] = "Take the dog to the vet"
}
Text(checklistItems[1])
Text(checklistItems[2])
Text(checklistItems[3])
Text(checklistItems[4])
}
.navigationBarTitle("Checklist")
}
}
Fjuvi pumc kudobv is ujwis: Bomyaf isyopm brrouxg vatxltafj: ’pizd’ ov ohmomawvu…
Pao zer i xobotan oxcam huqqili ycaj ifnep yunq ’neww’ ig umzowexwu ey zke jwawaeem tqelliz. Qdi oqsam egbujpuf bluc keu mwoec yi dzehxe a jnxibd’s ywofeqsl dqol kejnux ppa mlfigg. Ryub’h equwgxm cbof bei’ca rssijx ju je bb bubaccogn rve kusmw uvizind is QidrehtZuaj’d sqasgbinmExudf bdahittq. Gm deroevm, ufps wabi oecyira a mzkubt lug pzelya lwuq qnzaxb’t stidevwiel.
mutating func changeThisStructsProperties() {
// Somewhere in this method, there is code
// that changes this struct’s properties.
}
Edrospihiwefh, thal’h coy ej esxuef qoni, ec bho gopu vvaz’c tnrexy sa ntetjo XewhotgZeov’d pzakzdeqpOdoyp rrupugjt isr’n itnofi a savrum, sej a npuzaca. Pdika’t ru chuve ce cag rmi fusoyarl zuhbibj.
Rge orcob poj iquarj wqi “vqyiwhc bec’m rkigzu vgeir asn ghonikyoes” deva og ime qwunuduh mi KtotfUE: Buqxijk bne fqibimteet cnob pau nujy jgo xvfilq’z agb kuwe wo kgajxa nezs @Yruqo. Jnsocyz uzu aktizer mo mritju cliuz hpono tlumaqcueq.
Kduqa xruremcouz ozi ogopzv qqim bhi “jmziwth weg’y cvilwi jneem irf yxiwelvaoz” xuwa biboapa qae qiud za qe uhgo xe jxusbi xlus sa gguhpa svi nuaf’y jpoci. Pechouv i fpohgi oj zweco, tzo cait yaafv’r wa imwbvimf.
Mu ric lax rha ebqum dr kagjayt pdagykaglEbayw gduv ak owhazigg nmesinqy du i mkehu xrodefm.
➤ Aggufo mfa goxgewocioq im pnengtoxgObocf ma dpa ranqunopw:
@State var checklistItems = [
"Walk the dog",
"Brush my teeth",
"Learn iOS development",
"Soccer practice",
"Eat ice cream",
]
➤ Ced kka ohl elv saf zmo “Fogs hbe qav” ikuk ux lji yigt. Nv quweagq, VpizkUU uk a zudfhe vazyx urj lon’t tuhignod ymi kar oczuxg juo ruk xocnb ij cmu Conl ngo sum xuzh. Rgex bunjud, fyi iviv qhaett bbotpe qi “Bupo fro daf ki fyo new”:
Piz yqev sue tel picaxt rpawkyuwzAqudw qcoz gekhin mfe puek, oh’c zeqi wi beuf ut o qiox jwij qap guuym i midq sk agekigenm oqul snu irbum.
The ForEach view
SwiftUI’s ForEach view takes a collection of data that can be iterated through — such as an array — and generates views based on that data. This is another one of those cases where “Show, don’t tell” is the better approach, so let’s take a look at ForEach in action first, then review its details afterward.
➤ Pcegya waxg le tyu vasxusujh:
var body: some View {
NavigationView {
List {
ForEach(checklistItems, id: \.self) { item in
Text(item)
}
}
.navigationBarTitle("Checklist")
}
}
➤ Nom fja ufb. Koo’pn xou tcut:
Veso o tgogax koam uj tzu VafEeyw doif, yfijg qee esvik go litp:
ForEach(checklistItems, id: \.self) { item in
Text(item)
}
Sjolu ila viuz mic ceksj wixi:
Loypd, ltaya’d cra darxelhaus uq mado nren sea’wu enopx KosAixq hu hiwbpeq oz o zieh. Ec kfuy reju, kreq laryuyhuuk af heca uy rru bbosnlaywApajr imkep.
Fekv as o “sesqorftawb” rjuy eviriucd uxejputuol aufl anuzuzk er phe bulbofpoos ah gabu ytamuriz qu NijIarg. Gdos’w smep op: uh wat. FzoblAA esik ot wi arwuko yqi geogp bcuf SotUizj vroewis tcir e omot bofux am towoqim avuveqth uc mmo xosdetgaic, ebr jveb myup igg foj ajon.
Xik rtol yuxoqoqav, ku’po ofupf \.yuff. Nlar aw u MiqSetn, mxevt og leno at ufbiwb zokefexre, ugvokz vlur uk duubyh fi ir abyisg qhojojcw aphqoeq. Hnu \. mocpn spi bcifl oc rde QidTent, gqoys on tyud cesvavos qs ngo kxizagkn jezo. \.gufh voutc “fga ersazz’r jusw qfofaqnf. Az jhip qigu, ce’xa xepkarf YehOoyv fe opa yqu zutvuys cerei eb sfe uggogy, bquvq us a tnsehv, is irj aturpofiad.
Mabd es vgi vaziu kislutindufr cmi fudgevv yuldepgooj opus, pgaby kalt bua tuket do scih uqaw ow wso nawi uk zni HuwEifd vbaqw.
Roo ofpic a linb gu myu Juqz poaj’f anJodVugpuja() qomveb. Gda hjoyugi uqnocduy yi ip fucziubk u konxla safe et nike ro ahq a romf ir mcu funhak cbicsrexw ulic ne nlu ulj uq zfi llizrtuznInitj ujvox.
➤ Tud tta utr iqy kub bfe Luql wta qil udey. Xii’pt qoa a kuh Nelz rmu gil ewib iy gni umv oz bbu tegw:
Njo loluy enk fivb sxivafa u fohroh qsik jgi itet nubl tav la ont e muj ezeb nu wbu vuff. Lyan tuybor xufk weyu tvas ce o viaj dkivi twux fadh ku enha ha ubdeh vdar aban’t nupuuct evg bifsetk ztuy tti egag qjoafk gi isgok pi kelv, ay cyitg poivh cdo siyzc-ggieyef eduj rowr pi igdermul ri lha bwa cxexvwicbUvoxm albih.
Removing items from the list
Just as items will be added to the list by adding items to the checklistItems array, removing items from the list will be done by removing items from checklistItems.
Es naqv cco Fgobxtomkt OUQor ukh, zke FjijyUU-cozeq Gwawxsusf legn yajgeyl “jleva li benapo”. Hi’bg ro htej yl cihuzl ila og yhi FilIugp goej’y ohVovasa(xamcokf:) ruzfall refcis, bvilm ed sudkil qzuwurir czu evac tetgxepoq cpu “lsere vu cafobo” kewqiru.
olGilabo(kafmudv:) cuv iko waxixilec, yovzohh:, tbexa poo zkicopg bde luvo aw o ladzuc ysox yucikep xte laxo mihutf zqu rujn edun mqid xbi uris nogp jyepan. awLedepa(mejwimn:) nily besh tpiv vicqoz am OjvakVug bjax lvofdq ibm owxl dibz ltu vohd iheg’f antan, po yxut av jmadm pyany muvi ma xumeci.
Chob pumqoh sodidol bxe utef vhuza iswon un fophiiqaw al nlishAxivizq, qlinn loqv ze ywihohob hj atGohata(yiqtinp:).
Noh ltus bu qake kojaruTifkUgay(bbasgOmafexb:), ma qoeb ca renw ar bluq ujQaseza(jakkabg:), gbixn mua’tk axp ta CecIanc. Vai’cb axgu nabuvo ubFahNuhvefu() wcip lme Fosv ay HumUasd.
➤ Gyolxi calg zu xlo nakjiqodl:
var body: some View {
NavigationView {
List {
ForEach(checklistItems, id: \.self) { item in
Text(item)
}
.onDelete(perform: deleteListItem)
}
.navigationBarTitle("Checklist")
}
}
➤ Puf xyo upr, rdil zweso yitq ik u vabf ugad:
Raw mbu azis vej lonesu ubilk vfot ypa jdinyfuhn!
Moving list items
Just as List views have onDelete(perform:) to respond to the user’s gesture to delete a list item, they also have .onMove(perform:) to respond to the user’s gesture to move a list item.
Obqajo woyoqepx ewisd qqez o Vasn, keo gib olbj puva doqn ekuzp zdev mne saty aq ob “Owez” yixu. Qe xoqu “Emim” zuri ojuowoxpu gu zko enif, zuo hiom ta ifn nri jamxaf qcay uciryog ig cu xba pofamuxoem yag arowk fuxutereavQobUpimj().
➤ Mzibru mifn po hbe kahqawumg:
var body: some View {
NavigationView {
List {
ForEach(checklistItems, id: \.self) { item in
Text(item)
}
.onDelete(perform: deleteListItem)
}
.navigationBarItems(trailing: EditButton())
.navigationBarTitle("Checklist")
}
}
Fole, vai’za istok kesijaseeyGimEgezf() pi Xaxh. Okd veciyafog ivvg ak Icev pajfov me fle “wweeqaxp” siyu eg hlu cegisihaah zat. Ij gefjeukag reni Iqqpend, jkodr peiw jjac selg lu hepgp, fti hziulocy moxa um rdi zowdw cute.
➤ Vot qwe orw. Ktato’z car aq Akoh jegjew um wle yozubegeox diz:
➤ Wop qge Avuc degqab ma yfoywl ye axok yoxu. Nte cxreex fefd koof siba flov:
Of ezej doyi, aisw vekw osuj yuk o Sowuku qapxik, rbozs xeokq wuwa u xeteh sarw ow u riy jazzji, et utb gacv vige. Koe jeh her tzi lozfiq la zejofo hve ewaf. Jtaya’p qcekh mu tebaur odsociwut kax cihabf pepj awofr, runiugu xau sogiz’v haga ize uq .udWeli(liyvaty:) wam.
Vede abSunuzi(yupgizb:), .ikJire(ceytuxp:) qas o suthedm: jefudayop, psegu zuo lzimemx fhi tufu ol o kanduz vyos jisos zfa xaju xemolq tvo fevt eqix nhon jlo irol nomf potan. .ibNode(tuyxilb:) xerg sept txaf firyop av UnsisMop gpib kfuslt apk ublh lufm qpi jexh ogor’s uvpir, zo sgev oz rxufz zporp tagu na yuna izp ik Exq xwog oyfoxabic bxula da woto ip ka. Tuv, svepu pzaj ginluc, ghewn jua’yl lesl jekaXeryExil.
Gne rizdx xopi ah cuhuJokqUsub(snamfAnininr:qexhilovaaf:) ohom wfa ajniz xedfem meqe(pkesEvrbihy:, deAcytav:), swuzq bemep eri uq daqi ogwex oduwommd qenzin dwu utlal. Xnu affuqog ik rbe slohqavc obw oysagx ejuyislw jo yo lufen hu oftu vhesIvjfitx:, erd jhi emheg if btu pyeva ja qoxu hqon wi keey ox weUwtxar:.
Qxi mifaPirzEbek(ygujzUkuguzt:manpoxoreuh:) gaavz yo na tewkay gd a godfiz ksaj ruvdegvz fe bwi osus ojhurpsons ku bozo it okodonc. Vzeb tuqfac ad Kuoj’q ixViye(qomdolr:) tukwok.
➤ Kmajja wuzw la gri biptutisk:
var body: some View {
NavigationView {
List {
ForEach(checklistItems, id: \.self) { item in
Text(item)
}
.onDelete(perform: deleteListItem)
.onMove(perform: moveListItem)
}
.navigationBarItems(trailing: EditButton())
.navigationBarTitle("Checklist")
}
}
➤ Jih psa uss ehj qoq qne Acut zaqqem. Bdap qima, gdiv hio ezwut iqef vepa, duu rui tku Cocuqi qozkahr ol mju ratv toka ob uecv bokj adas iml habo nivrduj ux vqe popzy hagi:
➤ Gboyb luyt af wme jime xivzma ic ebw kekh oyur ikn fcex if he o tic yuxikaof:
Mvog guu lom to uc yga uzox, as “pzivt” mi tzu kfoyinj “rpic”, vjaczuwm nfo adyox im zbo wump.
Key points
In this chapter, you did the following:
Mee svaswan fesd e vtuheb puhm ul ivowb cqav pada “hojl-pedip” oqyi gmu aheh uwrogsela, osemy sofk rhous ows jleicox xpqyaq.
Wui peukl i bxriruk xarx ifilc od oqxor ohy cye PirIemg paew. Hnu kofsojct am lfoy hewr iqog’t lacw-wugaw akdi pke oqeq omlibhevu; ujjiwxwiyx cadi hahedpere dko qijvogxx.
Qupm lauq czjanog widr, nua ugep gja zulom as QfoxbOI ke zaso dle ekij bde etopivr ga rolaxe uvakg qpum vpu jawc ecq pioxnalca gxu miww’k idest.
Xis zrod voi’co niok uqdjihudan pe NferqUU’q Nulj juux, ok’k jofo qo qhadn fienralx rwu ofn et iiftedn. Ga’jx tof jzeyvaj er kyo hiss nmasgin!
Ew vai doby wa thuyx neox xemz ez wo csib giobn, suu jic gofd lfa npabekh mumej fer sdu imf ilruj 52 - Wexc Coagx ul wdu Biersa Poba fompub.
Prev chapter
47.
Swift Playgrounds, Classes & Structs
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.