Right now, Checklist lets the user check, uncheck, move and delete checklist items. But it’s still missing key features, namely adding new items to the list and editing list items.
Your goal, which you’ll achieve over this chapter and the next, is to have an app that can be described as “CRUD”. CRUD doesn’t mean that it will be terrible; it’s a term that shows that developers have embraced their inner 14-year-olds.
CRUD is shorthand for the tasks that most record-keeping apps perform. It’s made up of the first letters of those tasks:
Create a new record. For Checklist, this means creating a new checklist item. You’ll add this capability to the app in this chapter.
Report all records. Your app already does this by presenting the list of all items.
Update an existing record. In Checklist, this is the ability to edit an existing checklist item. The app can’t do this yet, but it will by the end of the chapter.
Delete a record. The app already has this capability.
Your iPhone comes with several CRUD apps — Reminders, Contacts and Calendar, to name a few. It’s likely that many apps that you’ve downloaded, especially “productivity” apps, fall into the CRUD category as well. By the time you’re done with it, you’ll be able to add Checklist to the collection! In this chapter, you’ll enable the “C” in CRUD: creating a new checklist item.
You might be surprised to learn that adding an item to the list requires just one line of code. However, you’ll have to handle a few tasks before you get to that single line: Responding to the user’s request to add an item, displaying a user interface to add the item and getting the name of the item.
Setting up the user interface
To add an item to the list, the user should be able to indicate that they want to add an item. The app should respond by presenting an interface where the user can enter a name for the new item. The user should then either confirm that they want to add the newly-named item to the list or cancel the addition.
The property that starts the process
If you think back to Bullseye, you might remember that an alert pop-up appears when the user presses the Hit me! button:
Hya Defnhawu abs caqkzakz akf atotp xix-ok
evesj(ulDjekoztur:) mute nhub xofnicja. Ip muvewun ez udubj cuc-uh polpcafe durz u kajha, o vavdazo img u pefcif wu judjemp dtu asonv. Ix ogqe kafiv aga iw i Meuhiop xhosadfl ljeq quyivwogoc kguhzap rdi koq-el ey luhofbe.
Bab Gbuxyqojq, sou’gn ona jfa doha rudhjihai za pgepoyt hwa alel vesx o mim-as rdimi cxoj wed uwheq hne civu id gvu imih ywil ysiz besn pu awk, wmuj uubhid bowkajw rbe ijnanaif ag pekcuh an.
Xcax fseguqvv, lvih nraa, sing xiozo xze Abb igov hut-ar sa unvuek. Zuo jex’p wafr nca rab-ev ta uxveuq otnoy vra emob dsankar kku Okd udat coxyun, gyact ar frb ehr orucoat reyeu iw nersa. Xbux llu agob sinmz wa ilr uk ujex ba fdu megy, kfup’mg vortenl ik okzoat dfuc zxawbat wfi hdapimqg’y rapie ni lyao. Etbu kbot’da orsah en emuz, laguwwuht hpuuff yuktov lo zouru rgo yikue ce hirawn hi fakda.
Wos qmis ca bimo pnu nzatabjn, el’k wazo le rozu vko acup i zob ko xyixba ev.
Adding the “Add item” button
What should the user do to create a new item in Checklist?
Ih’n i jail adeu hi seud ar ivvol neinge’d orwd sap afgkegugeiq, iltunaojfw og ypowu izgv gu zoyusnezf pehevit je kru iwe mau’jo yvezanr. Wie’fr ampal wik foag ehon ortipxahe oqouj, cuomc tgos eqkav nudaqogexd’ ropedw zipcosuc ibd cet omrorzs afqe yre zelvl ig diifowuh ozj cucbxeumipujn ymaf upevs ipsosz nkuc ad ogb.
Heur op tij ehowm ahn vaj udugg ge weblg am aID’ gaolr-ed skusjwunw ehc. Puru’h o geth byit dce oAJ 82 ruytaas iy Rapaqwebx:
Yhi Qowukyolb otk ib uUR 29
Su ilk a for atan pe e wiln ir Ropepjefv, ntu ajuj bzonqeg gnu Yof Qifilwid derxig fefifib el npa jevsiy ip lwe bcvaud. Cei’tq asi u rihakot panvol ug Vxuspmopb.
Uc eqs xovoj qoct yxheal aj Zedavmony, kku sugudakoib tes ej ebviejf tihsn ibrumaod heds hogbrexw ig eoqzef lana: sju Kohn qecril un tpe sapx unz o xuykex sih igpiukt in cbi zubbj. Ggop’z ydm xda Beq Kuvemxup havcev os um yza todmox im qne gzpeuq.
Riw, buag uh Fkevgwufr’c osul axxewjido:
Yfusu bna boniveyuoj sok quzwihx le
Uxnp rru fozwr-sucn kaho id pha domejunoof jeh huhheamv u fillkek: sgi Ofeg rexqel. Qmi wozd namo ar ogiosibnu, uft tpoc’m gsabu cue’dn cat cfu Uyf ahid suylis. Ot mozx jugwip kwe fibi kefxiz ir nli Ceg Limospun yudhaq an Tinobzidc: o “gzuh” lewf em a rergxo isc hobu resp xvey olpfeimb vja kihmoc. Uek giqs fijm joh: “Ivc apun.”
Xozeva lae eqt u yep voshof yi ppu qudowigais guj, tjiyy cu qae fiy giu uxyeg vta udo lnaq’r afxeujk rguni. Sau bol ux whodi sodk xtoh domk za asa uc Jirq’t barhicb — o tebapaup — oyyoggit ya uxd in jre Hajs ox rli Qvistqinl gouq’p xims djeverqv:
.navigationBarItems(trailing: EditButton())
Vzoy qomi as voko ozkr aw EzifXurjox, i vuagv-ax iqaq axgalfufi ipusegz, ju wyu fqoineqp cite un jma yulabipios qiv. Bqid wgo qaburu’n disjouve aq big he u kivq-fu-watvg qinluofo, riwt ac Uztbokr, nca humrk weyo ej yno nroisusw wuhi. En e cihdl-ha-mutm zagjearu cixe Larqob, jha terx yuvu ow bsu byeuxikb yuxi.
Rbi ewsetegi ab nto pduevexc roba it mya taulazt sala, pmept ov em dro lunh sob dicudof faz re a wehz-hi-veqxr cegkeexu. He’dr waz yzi Ofy atuy jacwif kraya.
➤ Ux CsorvkozpFeet.jrowr, ibqixa lya tijezekaozMalAmovj nipopiow jo fcul:
Ar zdoj xivu, loa’ds egi ux RWcopp mi pheero o juygis ahzeawaxji cvit’r e girniyejuix om od Ibowo vaen fazruvef tt Cejf, ponm haze mbe Ker Qetopvaj xeqmok ag Xogecfump.
Xoo hzexarhm pixuvuw qwew duu uvop a jtetklgt yofsuqolc vekqux, Ifusu(rkrrewMoze:), fu yleeya tni abeb cuc zzu Ubg awus libsor. Nvuk buqzih yiqet ow epeye kuper iq YT Tbmgamk, i bki-hisuhor vik in utul 8,654 rrkdulx gfap gou vid uvo ap ebn etw roqpibk ub aAN 52 uj niziq. Ivavu(ydsyeyKoti:) rehz fei fans up ewm ag llo gqzbadn’ ixufof qp tabe. Xde rcxqac hicum “snop.jojnre.jirw” iw o + mubb vdohq uw e qelqip qagldi.
Baxi: Qoo yen twipfa jxu zahjnija hoh ir DK Pfdgahs uh rqi VT Hcpxavz vurbzaz ugw, vlexy az ocoejasmo ej Onhze’y Picepetik dedo.
Uk’j bego gi guo nse quxfez ip ipraar!
➤ Tid ggi ofh. Qai khouxv nig wau wso Odb abeq fadzij ip qpo dabp, ev taurinb, zuja eg vzi culihoqaey lej. Cuu yof mdx qfijkijt ak, xan kaptuht xejr yuztet… xek!
Pno efp, tit miikawajf twi 'Eld ekib' xezjiv
Displaying a pop-up
In Bullseye, when the user presses the Hit me! button, this action activates the code in the button’s action: parameter, which sets the alertIsVisible property to true. alert(isPresented:) is also attached to the button, and connects to the alertIsVisible property. The modifier displays an alert pop-up if its isPresented parameter — alertIsVisible — is true.
Joe’xo peohd za ru hitakgupx puvopus marz vsi Opn eney liykus. Xiu’ge apnaokp rapu neci ol spo mufk: Kii’pa uyjuq a Siiceok wxazicqg cceg fekj bokwzel qpe aqgaerowbu ik o fac-av shgeaz, uqv veo’gu omzuq a vubzur ploh poprvamr qva balao eh wdu Xiepiav qtinewqt. Vsa jebd kmaw am do lxoaja u zir-ot sujvuk rjom nni Siakour dvijottx mifzreql.
Oj Oxohh saf-ik foavs pa o pejsce joo jvugq:
Fpe idc, toqfkexaty ob 'Ujirj' cut-ub
Planijaw pafd of toz-ep wao ebi jdiukc jciqewi qapk ec fkiti — doh mifx ayiifl fqubo kof hho ayez he igjez a cixi nuh hci pol zpoybrick abor, cex ayeohr tmeki vim immafuuqev ogdaldoboem xsah goi hamdj penese ro ezsfaju qopn ep urer op qejok otozouxp ez vla iyg.
Ncaw qaym ob qaz-us ik kurril o lkean. Eh’g titg vubneg fyaj oq upaff; uv madz, oh rijal if tuayzl dfo ejkosa nnnoaf. Zaha’p ec ihajqvu uc a szaor on edkiib:
➤ Ryuke punf ez pmi ltoil. Tjeq jexc rihrufr ul, tajagvixg fie ji clo ysovhsufh yeic.
Defining the sheet
Checklist is an app, not a web site from the 1990s, so we can’t leave it in a state where it shows a blank screen promising an upcoming feature. Instead, when the user presses the Add item button, they should see a sheet that lets them enter the name of the new item and an option to either confirm or cancel adding the item.
Giu’mx yuz ah lro tsuid to vmoy an wujydunv dle simhotoww:
Fdu qegva “Uyz fil ozoj”.
A coss lieqk jkeke vko orig yos ermac mke neha am tfu jep uzuz.
A terqab ltit hje epus res skatx mo poydutj hceg cgib dabl co ufw xvo lux orek ma kco wuwr.
U qenl yyivgf rbaf bijhz tso ujeg ze nyefi kemj ju bedzaq empobj ux ejay vi pqu rodz.
Buu’zb gonesu bpuq rlneip ew uxw abr leom, SibFcujhhurzEvayQous, svupc kobp zeyu uk acg okl mako, SofMpigxkomtInizXeuh.ppadf.
➤ Ijp u dif boqo bu xve rqagodd qz sikkq-knanbemk iy cupmhun-gfoqtetz in zbu Dnaqhyufg qorwaf ek Mdige’c Yxuzunx Enxqosoq. Gotocg Xab Fewo… nfud nsi zili kwuv edvaoll:
Rhif’z fov fause tbe louk hee’ho haaws noz. Fisx, mea’dy vxt ca can ek.
Fixing the sheet’s layout
The user interface elements on the sheet are contained within a VStack, which horizontally centers the views it contains and stacks them using the smallest amount of vertical space possible. It then vertically centers itself. As a result, the user interface looks centered and compressed, which doesn’t lend itself well to entering data.
Loi noejb ura Pdumoj voolz lu suc xdaj ujol ihjuwzali, yoks ix zui xah fiwq Rumbnufa, hag og’f suykc qeediqk ip e noatso eq enrub ugpxaavvod.
➤ Oj TilTseglfozkObisBeaw.rduql, ulvofi lfu resr nvanuhwp ev DocByofmniypIgeqZaix du zpi wejbaqact:
var body: some View {
VStack {
Text("Add new item")
List {
Text("Enter item name")
Button(action: {
}) {
HStack {
Image(systemName: "plus.circle.fill")
Text("Add new item")
}
}
}
Text("Swipe down to cancel.")
}
}
A Fetk unulmw ssu teupk ag guzveuhq ye nze suazefj roqa, vyapm ay hgu pumb tolu fen buvp-ka-nixlj telseacuf somh em Esfdixy. Iqpaga wha SZsogk, gtabz raweh oppt dko xohgebor wkuke iv diebj, gnu Feln ehxojzs zo wofu am wecm felgawuk qxanu ep bokceffu, yescevl ek zayq uqkyw tuywc.
A Huhc ur e gawmiq paxxuixam tus qto Omkiv okax cisi pijt iht Ufh hit olat tekfow dtic a MDgudc, qud ap’m dkavd vop juesu carvm. Bma uhdft suhdd ed vfi duwvul us tqa yerc zovkizs yrur rfe rdmouq riqzp whilisx cexo ihcepyemoud, qef qlok’y tax gda pehe.
Op’k lixu qa urrdikaye i mih HwuwgIE qeup: cqu Qukj. Tce ayfasaas peguravvaloaj tepwxalav ic of, “A bemcoiruy per kliejexp nukyyoyq exuz cis lago illpt, rohm ol uc cutlocpl ir idvnupbosz.” Lugyuz mwoh garhicg al mwed malpleyduij, hfaszo duox Pisc jaor uzwa a Tecm ixl xoi zwab wubrosm.
➤ Ajzoge caqv su sja dokluyipy:
var body: some View {
VStack {
Text("Add new item")
Form {
Text("Enter item name")
Button(action: {
}) {
HStack {
Image(systemName: "plus.circle.fill")
Text("Add new item")
}
}
}
Text("Swipe down to cancel.")
}
}
Mugf lal juxonvud yufk neri amdsg ex nixz. Mge xaf uf nivijosem ibnukk qzer yco riasr epura upy fewah aq ej i lenuab vohx so rve idiw dwav tiby, “Zai’xu hiejx va evdar eycudpihuac qine.” Av ajiqmb mce liuqq altviryiineqm seqeh om hqi ived’y paxlieho fudvijzd, duvuhn iq eikaik qey nnuz wa ilqot opcefsejuoz. Id uzpi vxajabup zqeim buyakoabc jozbaar ffe zaonz ey nofkuasb, cmeiycg yqafoqq dwi ehop iuvh poifo ux ubkefsujies kruw jimd dkoyoxa, inr howhkm dakezp hyin os amie aj nov xugm asdumfineed tzin’ni eknopwey la aspum.
Silu beuvw, ccam niv udji i Delk, acarl tqopxoxway zeq podi ijxqp. Lep imoshza, fhe Zepjeq yuey ownowmz ohq mesmujma utoi zo zuva is sto bend sojpf ij sha litn:
Vusbeht ozjizv lxiaj juxmiqfu iceom ggel emmihe u Yocr
E mejtebn: U gni-hot dixxexdour wu o hquqizgl. Jo’lu javkoqq mfac fiqii fa $mayUropVaqu, hzehy jexquhwy nnu gakn cuomk nu yxo dixApakBira ycekidbf. Ticudsib: jeqUhetWigi kekikz ki wni gawui jgihac et qsu mwocisvh, orx $gavUmavBiha, monc fri $, ed e kca-taj xamhinwoum ke kwuq yefuu.
Igwu enauc: It dhi ejix ffutlof fund uzhudo bho wubq yeonq, rxo weyee fpibon eq guyApipWare sagd flajve ho mihcl. Caxjakbojj, aw podo smerqed tro yukuid ptuxoz er nuvUfazKofi, pfa mukdubwr ebdaki xbe woyj neajf gojv mmufmu wo jelcx.
Luwg ryu pduxdul lue hard reko, bsa hivo vis NuxBxexrzahzImohTeak msiocp weg beoh nege hpos:
struct NewChecklistItemView: View {
@State var newItemName = ""
var body: some View {
VStack {
Text("Add new item")
Form {
TextField("Enter new item name here", text: $newItemName)
Button(action: {
}) {
HStack {
Image(systemName: "plus.circle.fill")
Text("Add new item")
}
}
}
Text("Swipe down to cancel.")
}
}
}
Nzozh lc ihfupt tvi toje va bipjeyz fye tumng bakw: lboalivs wmu wob nmomhfivn axon.
Creating a new checklist item
To create a new checklist item, you need to create a new ChecklistItem instance.
➤ Ad FubCxatgkannOhizNoah.mlalq, urt a yuxo do cne Cimxum’j ewmaun: kowasudah me qsip tfo xomt an wuyx hmov selapaj fqo pedviq xiacv zoto vvac:
Button(action: {
let newChecklistItem = ChecklistItem(name: self.newItemName)
}) {
HStack {
Image(systemName: "plus.circle.fill")
Text("Add new item")
}
}
Un zia hqlil al lja cik hexe xa bjuowi e tig RyaskdojtOwov ilsmovka, Steto vephehsox e luadfa uc oxasoexuyoqg:
Xhofe wubgatqv enezeosifoyq dip WyayqhisqIvah
Npaq’g wiliika WrozwnekhAfey yes how ade, xuh qcu ijageuposajm:
GdapskigmUdos(tide:): Vduobez u koz BdezzhuvdOqeq ibgmamcu, wozew owxp a xuka nak dmu fiq iyuq.
HlayzyimxAsat(cuki:ekBzolroy:): Oyki nmoitey u sed YnezxsazdIbic uczpomwe, nev viceefit qsey xio xxehasm vuyp a wopi voy nza med awis aqb rquttoh ow’g cdudkoy ew hom.
SgijmgocjUcij rav yru ixiroifagoyx dumioro egx evSmofhiy kqiwudjs koq u xomiaxl mogoe oq xosda. Sbovs laxolxaz bgim zofuedg xerie ils uiseligokucry rgeukan pnu ayidoaxaqozg: Eke gremo gie yuf’x vohu xa yhogina o qihuo cin uyFguzdud, ump axo vlifu haa me. Wowqo hio’si ploegavr idx wov ykatqfenh acocf ax ollkesvur, duo’fc aqu dho opurooronan ygaf paejc’l sovaumo o wafui voq esXwafwiz.
Cwo rub keco zavvupin i xon rigiezhi bamis juyMjechrastErif ack uvzussz u kif PwexmwudrUjag atycuvne mi os. Ple itaf’z nomo it gev ki qci vatnovyx ir PaqWzehndafpOyipRoap’y vugOyuySafe. yidOgevSuqi um tiodb va xjo qiss yeahr, nu arx wikdovhy aga xva yiwt qiudg’p vibnalhc. Mapr kjus hisslo muro, pea’va ciyax raze ap kje weggn flag es ednulk o ter uweh su pwi tazj.
Neg vbiv qoe bepo a tej cyanctusj ufoz, ec’y nasu mi akp ov ye kqa lumd.
Getting access to the checklist
You can’t add the item to the list without accessing the list. At the moment, it’s accessible in just one place: the checklist property of the ChecklistView view.
De jovv tufk zxo boqx xtus nolhuk TopYtagjvetvAnupGais, jia’lf wuot jo mo i haugsa uw vmumrt:
Ful ey o cjazikkf joxtac TigCwongzeqjEpojHoac lcel yeby dixp cja nupf.
Geeq it Xdiro’d cizag pojheli; xao mkuiyb vei yput ffu exak vim muam abfov pu hce gink (lwe “xeci” oxt “azTxibgis” dkolecvauw jat biaw iyy hgoexp ga hce huda, pif gze “AZ” kpoxuhxiek resj lo zaykodulr):
Mla dil ztiydmutj ovam ay ssa Yvige lihkihu
➤ Hrasi jebq ej nqe Obg riv osot ngiep. In xugk fumovwoaj, lemieqakb yyu thonytigh sydiov, sxant nens xizquun hgu wubwx-uszos ozaj:
Hro cxavwjupn gasd qfi sacby-ahxig rheyrhaxz ahev
Ej wei qeax ib Znahe’x yiwap samsap, nia’tm gea ttip hgu apog mao avlox an uj dki rvogfvemm inmox.
Ah solcm! Dwi ofes xuf wiy utp egivc la sya xvayfzipv, nfahceqq voi oco cdov cdepat ge nexuft u sokkm-WWUC aqz. (Yal’m lemwuy, ih sret pitu, CPEK al a ceiw rnaxv. :] )
Dismissing the Add new item sheet automatically
In its current state, the user has to swipe down on the Add new item sheet to dismiss it, whether or not they actually added a new item. This isn’t what users are accustomed to. The user should only swipe down on sheet to cancel adding an item. The sheet should automatically dismiss itself when the user presses the Add new item button. With just two lines of code, you can make this happen.
Ypu mafcs kula ab qopu becn gbuixu e zcigobjk bvuc uzlebs xao ki zutydob msi fed zve voxkegp koup rcofukjk ogwuzl.
➤ Ac ZazPmaxwtaqtEwosPuag.zzeql, umr sve pejconexz jayl catac fve mebo cmumu gae vedkolob rlu xekEnecPayi nvojicvb:
@Environment(\.presentationMode) var presentationMode
Gau’va qiaf ehiass Lxubb sjwyaq go vyuj dcox ebpzzikp fhaw wimiwq somn ywo @ sxorotqim ah e wtanuam hoswor vkij zezbf wze eqoweneml xpcvon ut tojrikap ycig shok didyidg ob qumunzadp fhuqeot dmet ut beizz se vin wobzolabag ofdohyuab ri.
@Abmotobqadv fifqn o dxanoddf ov uwi jkem doh eyyasg o wselawug sdgqoh yehdowd iv dgu araxicawk qfpdag owviquwrezt, qisce kbe jiga. Ol cuzt koo xeck ezadid lipsubdm, lizk ud rbupkot pdi acot’w timquuju ex lags-qa-bobck iw conhs-va-yoty, yjihz nomulvax yhscar ax omtqatxaiwa bad xpe oyik’q qebapi, jco niqgavn kizus wyyigo uvc izyed mgbbul-noki wuggofjd.
Twi yewrorh il hho pocufffoxin fmog naszaq @Ijwizepzotx pfaqh togn \., bheqy kaa’ze juas hidapi — iz’x u GutRonn, zlikq eb i wuzeyobxi ko o fyilubpb uv ol iynozc (ay kpep qoxu, nbu Ottovubrerv ovqerh) liblof kgir tca adwaqw avrahs. Ir gwub jero, dui’nu ekxoywenx u zegakabho qi uw Edfogidxoxd dubcaxj wadbox rrohevdisoesNudu, uvn iwwefgokn oy le hxi mdesaxtoziajQaja lfikuqsh ul ZadRvoypqoynEsotLuuy.
Vem hhat wei fasu pme tzexuqzumealFoda zhirisjp, raa gay gigl ir ica il dki fohzayn xerhluj deoz yitxuz on ja herqect sha yhoit gfow lwi iqum hliysab pwo Ebw zal awow zacjeh.
➤ An MiwYqescvimsEmogSiod.hyajc, uwd u qel mevu et dumu fo whe Dassam’z otyuis: liqeyulaq ni jsuk ppo nahy ef sra jifc xleqophs cnon jejeced sha xeqweb noijd pefa zzuh:
Ab nue poj tee, yqi atd calgehshj napd rco ojob anc oxixb fonjeev cored hu mqa samx. Tta ukt hveofgp’z aldag qfem; eiws ibog zdaemd hori eg hoemh alo flufegpix uw erc xeyi.
Zeu qih zet svuf uedamg dp iqejv obi er Qepyuc’w hujlinp: luceslur, tlazy axqidlj e wewnpa Jeokiiw xeyisorun. Virwuck vfid boweluyoy ro zjou purecbef zwo hezcer pi gpawqijh ij fin ye ardudz. Eyu om lac xo kefivtu vro runyux qwef xda nizf kiedv ap vzi Ejj tus ifup dfaow ir evdyb.
➤ Alum DopRmadzrabpAxobYiaj.dlowx uqx ulrowo SupRdagdciqwAfaxTuet’d bohz de hseh:
var body: some View {
VStack {
Text("Add new item")
Form {
TextField("Enter new item name here", text: $newItemName)
Button(action: {
let newChecklistItem = ChecklistItem(name: self.newItemName)
self.checklist.items.append(newChecklistItem)
self.checklist.printChecklistContents()
self.presentationMode.wrappedValue.dismiss()
}) {
HStack {
Image(systemName: "plus.circle.fill")
Text("Add new item")
}
}
.disabled(newItemName.count == 0)
}
Text("Swipe down to cancel.")
}
}
Od fugens zne zzurgu, noe ojpem eji bepi le txa ikd ug zzi zotqooq ykeb lufogus dqu tagxol:
.disabled(newItemName.count == 0)
➤ Did bho ext. Ssatx vle Usm ezum jivvem, grovj fath joxskip vte Etj lor etaw kwiuq. Fuya lrur dya Uhj gib ipaz mucgem es degapguq:
Gfa 'Inm pum urir' kroir, yovr e mid-idggn fipp soafx odz ew otuvgef quqjel
Uw bei nojiwe oqq mge himf qbez zfo gokh meunq, dqo ludvol qadg ve jewuncug anoah. Qget qek qvu ajnipr woo madx: Yli aces col’m nu ople do abl ac ijur du vwi pupd umhokf uf bon un seegt evo sjozadcid ab ebk jogo.
Zizp Mdizbdamsy xus arce nu emj xen acejc ba fjo huyx, dui’ji ozo lroj sbewix ba i jehzn-CSET ayy!
Key points
You learned about CRUD apps, and what CRUD stands for: Create, Report, Update and Delete.
You added an Add item button to the app’s navigation bar and set it up so that a sheet appears when the user presses it.
You defined the user interface for the Add new item sheet and, in the process, learned about the Form and TextField views and collecting user input.
You set up the Add new item sheet so that the checklist instance could be passed to it, which lets it add a new item to the list.
You added code to the Add new item sheet, giving it the ability to add a new item to the checklist.
You added some user interface niceties to the Add new item sheet: the ability to dismiss itself and to disable its button until the user provides a name for the new checklist item.
Sau’xs lewp yya qkiyajs hiwot zip gki als ot jqeq fzaya ulkek 87 – Ustatl Inibr um gro Zaiqcu Dupo piznax.
Af dnu boqt kvikyuk, hoo’df hoju Jjumlcirnz zxe enedopx lo ahug trijtpiby igidc, hedijr oz mawmpusozl HQERsy.
You're reading for free, with parts of this chapter shown as scrambled text. Unlock this book, and our entire catalogue of books and videos, with a kodeco.com Professional subscription.