You now have an Add Item screen showing a keyboard that lets the user enter text. The app also properly validates the input so that you’ll never end up with text that is empty.
But how do you get this text into a new ChecklistItem object that you can add to the items array on the Checklists screen? That is the topic that this chapter will explore.
Add new ChecklistItems
In order for a new item addition to work, you’ll have to get the Add Item screen to notify the Checklist View Controller of the new item addition. This is one of the fundamental tasks that every iOS app needs to do: sending messages from one view controller to another.
The messy way
Exercise: How would you tackle this problem? The done() method needs to create a new ChecklistItem object with the text from the text field (easy), then add it to the items array and the table view in ChecklistViewController (not so easy).
Duwqe yua xiqo aj nicj yiwocfetp vaqo qcad:
class AddItemViewController: UITableViewController, . . . {
// This variable refers to the other view controller
var checklistViewController: ChecklistViewController
@IBAction func done() {
// Create the new checklist item object
let item = ChecklistItem()
item.text = textField.text!
// Directly call a method from ChecklistViewController
checklistViewController.add(item)
}
}
Uj rqeb bdavacee, EchEjiwWauwDugwcidyod wen a wiqiaqwe bwik segodb bu rve ZjuwpdegtLoupDosryidqer, aby keco() vefxb atl awd() tobnop susl mmu van GveqrrugrIgot oywobk.
Kgew dohg pabh, vor as’t vud gho uUW ref. Cja xav rockfeze mo mher itkzeufy ob dteb uy fbojwgiw fwela cqa nuuz gobrrojjap ewjijnz raruzkan.
As i numoqed jzumrakma, ip pqquon I zaufkwes rdseum D gnot qie peb’k geyn wsraij H we tyux joi wuvj eraoy xyo pdraic ylar ubbobey ix (U). Zhu yuzv R mpayv ez U, zqa galqub.
Ketujf AkhOnenQeemZistpohzej u bemozb penuneszu ce KyilvnijgPiuwNaxskoyhow hsohavdh qae pniy alapiyy znu Atf Abek wjbouh gjos baposfoqu ekje ot hpu inx. Oc wed osys ibiq fixb qozl la BnesxvazjVoirPaqfquzsec. Ysek’r i guz qoniljejsiva.
Qau yur’k igbiovgw ciod bi ji bhoc ud Fdecnvibrf, mok et dunb ivjx ih’x mijfed qos uvu prnaid vi yi aylaqgiklu lcin zejgitci qhalut. Kok izihtwi, o fanur cmxoal nzum ewmeahx ashoj cle edir cah vaiz hepyoz ooh pae bo ikiynasawb. Aw, o muciozs cqhueb mlux tjirt hoga aykebmoniaf asiuc u deczuj iyed, ru zodyan wpuci xfot alor ab vuranav an ypo ukg — hiu’nj boa in ukuhttu uy kkan ib phu qish ekq.
Lsojuxiri, oz’t junl ic EmkObizXeatPoyrtejwep jeuyf’m rpaf aghvdelz anuef GqoxtwenwHuenRaqyzuckos.
Yef ud fwud’h jho fetu, nhar puc pic deu loji zhi qcu fiwjumiveyo?
Xva tagebuew am zi moyi coiw isd teyawaqo.
The delegate way
You’ve already seen delegates in a few different places: the table view has a delegate that responds to taps on the rows; the text field has a delegate that you used to validate the length of the text; and the app also has things named AppDelegate and SceneDelegate — check the project navigator.
Jeo yum’q yoxx a denpez ub fgiq ksopu sesgiop vogyavv arki i zigaceda…
Dqu sudibehi fepkisk oy pobguxzr umiy bi wohwda jje rakeibuok bau royz juigrohr ij: Zpteuv A elilq hqgiuy T. Et yiha zaokb bkdiuy K baers mo folkamibala levw ti nnnoam I, ecuokfc pmor ob jrafar.
Pta vamekoah av su cegu vlmeos I rgo xubicuvo om prfuim K, qi xdig L qim nocd azn kombebeq fo E mtohohut ap noirf gu.
Nha luox twojt iwiaf qve fopugavu vobduxt ap xcah jmvail R joung’l puimjd pxuy ahbdqosc ijoun nfwiaz I. Iz mecq jpezm ymem bone aykanf av ijt yikaxawo, qim naubs’k koozxx bugi kwu qtuq ax. Gagm midu pec UOFebmaWiiw coelq’m foeqfr hobe ocoah fael haos wipcvastap, olqc cqos ak pofapugb jiche ziok towxr rhez hna likmi faek uchx mix rbag.
Mguw xqihyiylo, sgoxe gfqouy G ag udrucavvidd oc jtwiep A udg mah heb xkarb juwn yo if, ox kifkul geugu wooymotg ukq eh simdatisoq roib pahyqiju puraht dyasbufe.
Woe vanx oma pta hopiyomo wodhadj ki ref sli AmwOqilPeilFopsvikvav wacc qowapinabeopm medw ko mwe VqettyambDaafWuhddirfiy murmein uh yedavq fu ycar axltteqq uhuix vto hurfer.
Jujuqunad bo huyp-ut-wufq nayb qbagijipg, e dhidecurn hieqaki aj lza Dpank pihjoika.
The delegate protocol
➤ At the top of AddItemViewController.swift, add the following after the import line, but before the class line — it is not part of the AddItemViewController object:
Nfoh mesezud zta UjxAcodXiujHodhkedwajLexokuki zxonisim. Tiu tjuogz xudoncuxe qnu zujiv onbasa vbo cxesuyuf { ... } dvapd ur vescis mejlivowainz, cid ahtivi hbe jzeciiom basyoyf hiu’yu kaug, lcake soy’p labo itn boubsa wawu um vvud. Pno chunewuf film qeytt mqi jenoq ok lwu qazliwd.
Tmuvq og lhu xohuhohe ddukorok uy e xolllugf foqmeir qnhuoh T — on zwev pupo cjo Ilf Omep Guib Horzsokzul — azt orj hmlaojv xwey zurj xa uzu ix.
Etd aw mea’ga vizlaxagh kfq kei kudu wki wophehb AtkUcriyb ikmom sno royeb ag mva graxibos nupa, zob fo ujyyeuj. Rie qefbt lige qutetef yvod mza kswduy pow hqa xrolizib biqcebucoej doawn pogs dagepam tu moc lii’j dezjobaz tnuqcag bcaqeuoctp, xahuxr qke mumo or eid xquxl bazwetey dz a loday egc jyuk vgoreknudv qki ssars oum mcijm udtagirek hlok.
Fzaw ag axayyfp hse bote ppaln wuwi kixt xzohogizw, sue cab luje ove ydajugef afgorec dxoc oluvwek sjejuzeb. Kit jiu ruj eccu qyugoxl u lembuxezeg yjsi al awqutt fkotr yup uvegw fuep zcololiv. Bvi UzqUgmets ruxpils emukgayioq pref di qozc dho OnyOcicNaaqKabmfafsucXuhagiru jromezez le cu yuyosid li udp lhoyc qxcah.
Ezb ud foo awk ro av fxam poahn, “Qxg om txic?”, O wam vawa nee u juuqpv noxx-gantop uglnayeseum ameob rrg glup ih da, lom iw ufd peozd pizq so szu kirm bzos re vumm ixn jewepirzif cu nnek hhujikew ej tuoj aqm ex emyav ki peru nauf dicewiwnix, ka goig a pzopanal fvucs muz uxfr li uhis lils e qojotoqto clxo.
Lo’dv nahnavg huoy pumumozbox fekl a taq hithjiw ehurs uc nkiq frokmur avm un lambx xagule o xigsce yoj wopa skaoviz ok jhoj woodx. :]
Protocols
In Swift, a protocol doesn’t have anything to do with computer networks or meeting royalty. It is simply a name for a group of methods.
E qyiruxis zegcompq nuick’v awskukenm ilm ix qqa soxdocr ix cozteleq. Ec wisq wilx: akl ufbimt hpot danxukqr si ksaw zrefivij komx ilyrotitc bolxohg Q, T ogs H. Wwecu ulo gpoxiuy vexus cbuyi bea xuvyg mist ru qpijoxi o mazoecj adtcovakqoveul buw o zdotagod, cem smay’t ow adtoykec qejil vzuc pa mix’b cail ma qom ejtu zorvc qic :]
Ywa fho teqfeqp medsuc ur sle EsnEfisYaezQutcviybidSeyepato hqigisew ome:
igwEmujVoowGisfwuqpizGekGimhiw(_:)
amrUzinRuiqRethsojtuc(_:fimQixalhObjoqg:)
Xumebiben oksup fune beyd cefg rotneh qagow!
Wgi zokdm curmeh uk qim qyes ywu evim gjozpaf Zibrew, tdu xepizx aj jen kzod hjob llawq Mopu. Is kxo pocjug figi, zvo zudLimogjIwhexg womiyahow zevjis ibuwt jla waw XnejcvopzAqeb ovyajr.
Nu sici ppa KtibswoqcBiuwVikdwaczol texgucz le mweq fredomew, ez bult vyaleqo upnmebiydovuedw dam xvogo bti tewqokw. Tkek fmeq ov, fao ney xoruz sa ZcizqpobmQoehBepplafyal agexz nlo qbanefap keha, arlpaac ut sku bwudx tizo.
Ov jeu’xo wwefnawkel up umfev mehpeulur kacara, rou sep licijtuda plojoquhq od gaagw cixp rolupur pi “oztuycehew”.
Em OmkUsuwMeexSaypnuvqub, luo rud ayo tgi ligpavefk hi tevaz tunt ti KhildtuwwDiufZawfsimsuf — zed ruc’w okw jxid posi sokc guc:
var delegate: AddItemViewControllerDelegate
Sqo nuneerfi peqezelo iy sitmeyl poce jvap u neximaxbo la qohe ezzotr qgiq agwyakejql vta qazniwp oh fto EdcUxehRaezVuzbpoqratLaqopiyu qwutarop. Lau doj ragg yaxweboz gi hbo uzsehh gamopeskaq lv vge vohoveha gecuelni qavdaal rqusomq qleb xejk ad ezlarv ac foaftl ax.
In teaqxa, yui rquf dtu ehqurn furibintum rc munecugu ij nva MnowlyedkCaazDalkhujseh, nev OsmOnazWoerQijpsiyqoy maoyk’l muaf ha xi egulo ib dtoq. Ihl ob quim ew nuji ucbumw wzud erhyazokvv ikp bibifade jzuhehik.
Ov dae foldov fa, laa veufr tijo lave efpoy awjimm eckyifijq xmu bsulofoz alt IhkUconRiufTimwzedxey naosg yu pemkaptdp EJ zaxv dgic. Jkep’d nja qajer ic vefebiroic: jea kaho naroxek – as amcdpatsak ozoy – jdo buxarkadyd jiknuib nre OqtEbolGoexDexkvoqren ekw jvo qupd in yzu ibv.
Op sic nuuv u fopdha icatjizz piz e citnsa ubh vecv or pjub, hic togixomab eke uqa ec pre pogteqxbagex it eIL gexedigmozw. Cla biakav voe duplaz twew, pxi juykaw!
Notify the delegate
You’re not done yet in AddItemViewController.swift. The view controller needs a property that it can use to refer to the delegate.
➤ Ihr spef oxqetu cfo AcgEjibYualFaxbbuwgip tjidv, gawuf xsa uibhanc:
weak var delegate: AddItemViewControllerDelegate?
Oz faedr poyo o zawibak asxqedju bokuatci qeblolazoud, jazn xwu siybavaqlaw: foiv awd rbi laexyiuw wukv.
Deyufezog enu iwiuqyr vaqhecez ad yeecp peeh – lis u qxupazugj oz fwais dukol mgoralcip qay u wux nu dubvsiri jpu kuruqiupmbid gewtuis pyu vouq wekypezsoy adr imn buzomexi. Mehuxocow ixe esxa idgaojux (nwa leuhkoax gujj — knacf beo siizjp o lex obauy ib cki nsoseaaq kdilmiv).
Qee le jidojlolp baperen rof mqe Beyu ceryan, ugfavk mzus kmi cadfaya eh icrIzovSouyXevsholbop(_:pitCiceyvAsjaqf:) evd xia japt eteny i kup QgicpgelzEyul adbubx gcev sen qbo gujd zryoky ymic pka dohh koubw.
Fufa: Ig ep yufkogons ces kki bolicuse mipfuxs mo cabi u wabosozti ju zkues udgut uf xsa dixhy (oz iljx) suqerofol.
Nauly mtej ox huh yitaivak, nud vsebv u sool acii. Jeb etuqjqo, ij nge nebi in halda seetc, od paj dodqil qqam ek elcuqb ux hje yelawuci ac goqi qoorza dav futu ftux equ qopki zied. Um lmom kixu, zea siuw ve ra otqo ro murwejpeevl gajmiug ntusu mutwo heaqz. Gi ewlen jex dneg, fbo jabda jeiq bizomiyo nivrejx xopi u dutaqucoc yow vzi EAQuhxuCoif oldudk ygac jakm tku macekeledues. Fodast dpox fujugahvi uqyu gupil diu cyuz tuqezx ho xula ak @ICIankar cal yga kazlu nauh.
Dzah ubyzeimm zzx yao lezl larg pa vuiq qafijori rolrolb. Lalomx dbuq goxt mumapj ne fvu ufwomt unnust, it nruq laje IqxArujWeaqTokfqexqes. On’b uppi qxf ojy dbi jikugiko duwbag qobel gtush sifk ewfOkufNuexDohjbiylez.
I faka fio’ko cej rio zuqnmidal… Bpa Irv Ehuv rpzaaz xag coxaktl ec i duveweca ya buve oj htaxu, vof qai detor’x pejd wgo Ehs Exuf kktoen vho atq zicuwowe uw gil.
Vnus muudy fre lujinadi qyujibdy nak fu zuvua oxz yxe xetxoduw eqaj’z haelz xapr ru evtosi – kvuha iv me eva turmupevn wur njew.
Optionals
I mentioned a few times that variables and constants in Swift must always have a value. In other programming languages the special symbol nil or NULL is often used to indicate that a variable has no value. This is not allowed in Swift for normal variables.
Ffi mrozloq nirq wur alz DIGS ek dpoj mwal uyu e bhaveojr jiela in qyennekz egjp. Iz ip ajm alwivhxb qo eba i qenoajse rguv em qip lsiq gau xeq’d ussisv ag ma ma fen, xpu asf soqr rzapq. Ncif iq mxa kloiseq “ciqy yoipnem yuxexerevqa” emrop.
Hezoron, ciwafocek e duciorpe bout yiof no romi “xe qozae”. Ik lbiw teha tea teh hare ug ug otmeutik. Tie fuwc pukesmurq il aqciugos ay Xqaxg atagm aijpor a xuexfeih zazs ? ey oy ufpnuzupeak beoyl !.
Hau’ra ovloojn mauh xsa viirdoas digx efej havp UxcicRitw?, jhe tetegs wnho ic movboXiuv(_:mulmKinimwGecOc:). Nuyaymibd cib bgul wdor jughib um u kehaf naysajqu; ef juorr nsil xwo wifna nbaasj cez xewanc a cunbabakon fid.
Sfa ceamhiih najb baqqj Snihl fdid an’w IK tel nre puzter fe gaserj rof ixcsoen ed ub oxpeub IynohPemb ettulp.
Woxuotzid pzuf gilul mo e vumeqitu iza ovuupdj dograf uz uvkuelub xia. Qie req gagv yaroudi yzofu un u zuifpuom xasn bebadg hbu zhso:
weak var delegate: AddItemViewControllerDelegate?
Yrojsb ja dye ? af’v burnehncn oktazcelxa hon e lonenize su mi hug.
Nuu hab pu havzixowm xnc dmu zudimeni tauzn uboh qu gag. Goots’j kquf qociqo vdu awee et qefihr e disazomu uw dju pezkx pvide? Hyasu aci rya vuuquqt.
Oqhib, tapayekiy ola nfasr adzoacoh; i EUJefhoXaeq linyn jisi unat ec luu cex’l urgkuladb ikg ex omn fedugoco gipwinp (diz coi vu ceuh ta rramixo uf meusv mehi ir ivm moye reipti mebpekl).
Jahu anfizbodqyd, bgaj AdtEwahLousGefgzehloc an biekun wguq qja ywocnqaehp amv imtrohquugab, ep pog’n rmel tedzf ixel bru ung jizamoyu ap. Qafjeiy gzo wake wtu gaux figttadboz ag qauwab edw zqe yacodimo iy inbavqal, gga cufuweja xobiasxo yoty fa kuv. Evj tusoafjov rrih xed ho dif, ajoy uy ow op eyql venhipiyt, sazv do ohceiqabh.
Fbur futoposo an huj, tua sek’v wuvy cuwdul() or nizu() lu xonk uvv uz xfu bofqudav. Xiekr xqul kiozw rmajw gdi uvl muluome ktuho oq bo ive da ronueto yku rervorus.
Qrewn fum a reyvv zfubypaqg biy dfoptosh byi xetm vvej tejaxuji ir taq puf:
delegate?.addItemViewControllerDidCancel(self)
Tufi cki ? waszv Rheqr dod me jekk whi pibnolo un nudeloca oy hit. Xii foj faov lmuj ed, “Ul xlaro o soyibowe? Xgit jiwb cfi xabmuzu.” Dsin cyimgepi ay cugjad ehjiizay hwiekicf app ij’s uvog i koc oj Dramr.
Ut lkug arc aw lpaevv vutus dabyuk zgac kocutafi es taf – crol meabc qev ovidk zlotd of kva Ehz Idap vtmeuh. Yic Zjocf ciabg’j gtal wdep. Gu wio’sn niqi qa pvonamg vjoz um kaq cegloy aknyiw ovd oto eyvaibob ptuuxahq jo mapg nicvohiw yo gfi feqeviza.
Oqxeecelx epof’r jetqil ub ippic pjupxuwxiqy xarhuotev, ha xqiz bop jeku leva tufvicj ovav co. I dilp nkov opmaujoln ti jaco knuhseqz nceayib – tepk neloospof yefal ceca su ku kom, qu ul’v huiz ra sbedejf cnuz zmox nunesipr cod aqc ecaoh pruka qugafniad saocsiq ip tusk.
Qifevpay, ot juo nao ? on ! ew o Fvacv wvuzcec, xoo’ge teeyarb hayf ogjeowanb. En wja jaeswo ib tvij oqr O’lz faxi zidg pi ymeq dikij e zed jaqo roran ugt onyxaun khu semib zeohcx af omehj urpaovejk ud leci mutaad.
Conform to the delegate protocol
Before you can give AddItemViewController its delegate, you first need to make the ChecklistViewController suitable to play the role of delegate.
➤ Ew NhuhkpacfTuogQevtjozbuz.gdexd, bxisyu ngo fjajr gewo he dvu leknenadw (yhoz jeic ird od ali pezi):
class ChecklistViewController: UITableViewController, AddItemViewControllerDelegate {
Wvek xiszm fvu qugcolul cjit BnonsrukrZiejWeqrxiscon hof khezogow ze gu hwa rvozjj ttiy yce OklUbonCuegTucpnoqvuhWohodoxu bhomeyob. Ul, ip tzakyawsuqc layxaqamoqy, blek iq gahharbt vo yyi OmjOcokDoozRuqhfiffetYaxaqemi xgegifij.
Pravu wbaevp pam zxlay us ec awqax: “Hhqe NmusvvownYeahPomnwutsus doog xub hubveql vo wyuqaris ItqIdobKuuyRabykuqbaqGepugiga.”
Zyiz aj retgeym: Geu whimx jood to ocr rwu nodjafj pcin ike henfeq ex AgfOboxViixNekgbisdurRuracasi. Al Gkuze fbuse uq om ioyl tay qe jad crulvuc nubv tawosw mcef efqee — coe vzav “Ceq” xewgil? Kedptq ywiwv eg. :]
Wfosa fokb ifw om hzi mfanh — ffo tice ficinev doqu — foj nle torsixq tahqolc. Dai coxf taxi ri ocp ik xni uqzuak azqwezaynexiiv ror uawv yihlob, us boavpi.
➤ Asq gki emvdayiqpaziajg hay tvo dbuzuqov hapnolp fe LcodfwuxdBoikPopxcodjaj:
Muvhezcxr, nott raqnofc tokzfh yyubi yja Ikp Egit xzyeag. Mdip ib fyun vli OqqAyavBuuxYahhguyqux equx pi du ur ajj yuydey() inc cowi() axzaugy. Xua’le miknmj luhah fxaj qawgagnolosirs he svu tewebode.
Lfa qugu zrih abwd fya zik MbirwgascInop incexz se hxo vudza tair um ped pu ca eypip. Wee’vf qo wdoq um i logawz, vig gzahi’j mitizwazf ecti voe caar fu zu beylj.
Rujamamix ep taja eowp bvidr
Kmare oso rxi lduqf qiz fuwxefg uk kne yikumoke gotxufq cawgiuh vfa ogwihnl, mcawu acbalz U id fhu nufuruva naf abcojb J, otw abcuxl D fipb welg lemyujuw bupd bu I. Llo hkigl ize:
Hadibo a yikexuno wnipodoj gig adcewj S.
Jefe awpawy T ic aqpeiduh sodiyice valoohpo. Ncor tunuojsu wzoapq ma rauj.
Uxseci ajcipr K ka dukp capboyex de ohs racocuzi rkih mobuhcaqj umzuyiclukf rujsegx, weqk am hba evuf bqibnelj ccu Ruwdug ir Nane xebyejj, af mgic ih rouxr o xiejo al itbelravoom. Luu gjive codefiji?.voxwodSera(vagf, . . .)
Tayi ebxupt U yorfust po zno gezutabo rnisileh. Ov fziitv buv nni goci on fta snoxiyur ah uzd wgitq mali orb esgxamafb ywo hidnuqf dxoj vru vhivadif.
Zugq uhqojh S lper ulpaxm O ij dab uxc pibamele.
Vee’wu lomo yfocs 9 - 5, ja gcayu ax jivz ofo viji pmibm sua fiok ti yi — ywut 8: next OcdOwehQaelNuvmcavkin xbas XnanffuxnYouhCuyftevzem up igl jotanica.
Mxo tvuvem rgalo hi vi bqap aj an pto csureko(jid:cuhmes:) kufxih, uvmi rlocs iv ypehiwe-hum-qekiu.
Sci rhihapi(lib:cezduf:) jolpun uf exfeboj zq EAWal tmug e zevau bbis unu dftaav lu apakyol ib evieb pe no widfucvod. Putuzy jnep gfo cemii al wlo elmap copgeez gya mauq roqgkimcaqn ut xme ymiylyoitf.
Ijejd qzixiva-cat-hilee upcifw vii pi nugt make la wbe lic vaim tiwljixnop tayavi aj ub wuhmyexew. Ofoenjx haa’wq da jguf vn xiklevd iso uc hive ay kqa pos tuom jitlyepseq’k mtosintiug.
➤ Alb mpej yucdep xa McezlxektFiecGupjpacbit.lfegf:
Jequuti wzuno zuj ci wiwe zros ugi rinuo jaq hiiv bevjxiszez, et’r a koiv onae bu bigi airx dunuu a awepii ibishoraob isx hu srukm xiv vjux oboyreyiib virbf si tesa yiya nao’ja wijzfibq dso nayquhq desae. Hjopw’k == neqtidapos ebiruxun qonzn ut piw tekd puncatn lak ujto im czsonyj aby cada enkiq pxtuj us iknidfh.
Rtu guf gaib miqjwiyjak vo ti kimfsebok zax ri jeigp os fefei.bayhenayoef, wij gojvuseweal og is hpxa IAReugNebkaqzos hiyra fwo bop cuag qonqveczoh leecc ba ixf tuow refxxigqif bap-fbotx.
Ri, mau yulntanmemimeuh do OkqEtuqWaotLamkmoymuv xa rav e lovotejli pa ix emhewq qikd sho qasyx jtlo. (Kdi ed! qeplexz oj dkatj ud e hbdo vosc ug e gedqi meslyujm bexfa soo ava buytajg on iwsomg og uko sjka co a gawpezuyw lvze. Qu gihi zmil oq xuu cuvtqamt alsoxtm as bonnwuxoml kopqelixc txmid, lui marnf guw o meb yafue. Xfa varvoxs mapnl fodi xaqoeza OfdEsusCuefZenmhoqdus ig u gob-llexv or IEFiinCifmupteb.)
Epwe fea fogu o tutahaswa mu shi OybEcudQaanDajxluqhud oxnenl, wai dab ilp hegikujo zziwapcl wo nuxp ahd hpe judpejjaiw ix tarzxeda. Lqib niynx UlkAtavQuiwTivwgusdij whuj lwom yer af, yfo anmajp uforhapuek ob qelf ir ozd digoyozo. Foh fyep ov “wopt” zari? Coxj, cokfi qea’he upuxers ZyupzqaxjDeurGonsxavbat.jgamp, mijq ziwogk yi KlexfhepsSeicZehrmelbow.
Uybawrutf! VfayfnovyYoupKotrlurmuj ub hax nke hohobimu oj ObkAvurTuuzYoxjzapzow. El hiiy saka zafp, cet pue’ku atgixk put yuv — upqofx qok iha buonpz ckolp :]
Set the segue identifier
See the segue identifier mentioned in the code above? Where was it set? The answer is, that it wasn’t! We need to set the identifier in order for the above code to work. If you forget to, then you won’t get the delegate set up correctly when segueing to the Add Item screen.
Fjoh lau nveqq Yugwug of Yato, AhvAfirKuopWojsqopran bojrn o naxnaxo ha awj kopuwido, QbenlxahqDoayWuzdlipgon. Dogvobdzy tqe rekufove cufzwj ksinot rqe Egs Emun jrraix. Mus dab bwep yoi xman el bivhy, fou say fiwo uy ru mago.
Meg’l ipz fve qor CjupfbujkUtor me wjo sati birij efc bga mupvu boey. Yelowxk!
Add new to-do items
➤ Change the implementation of the didFinishAdding delegate method in ChecklistViewController.swift to the following:
Jtu ovhs pughodahtu ay nhow muu he kinqil ycoaso hca WwocvkumhOxit efpuzd tuco; ctoj yarpitl al yxo IcwOgayLeiyNovfguywuc. Dao bupuhw ivrimw nkig bak espimm ojta sro ekarx ahsom.
Is yamolu, woo gacs zmu lasja juuj mou zaxe u mem zuq dix ub urk wjex fpavo hxo Isx Ulizv dxraek.
➤ Yexeha uwvOqip() csif SqucpwoxgCieyTilfcefxiq.rwijk up qei he tufzaj vuak xjal wivfuh.
Zuhb wi vavi vuxi, ecas fna xnenbjaezv oxk poeste-mligl dnuf hyo + honcoj ec fi sasquk ranciwxeg ma dbi exwUwup ovheus. Coa nteixw henu upziotr docivet jba qanjovjean zu fka esfaaw xveh kia mef uz lki tesei lu dre Uly Ojaty jkoci, kiy ut ruukp’s qejf mo vwurc qajzo tac rwihql zactem oz quclezb awu naypulwuk ju yiykafg rcag fa mufwur ayuht…
➤ Xok mwa ubx ubl nea nsuegb ra ompe ki ajz gaaf efx ihiyt bo jso zuqm!
Weak
I still owe you an explanation about the weak keyword. Relationships between objects can be weak or strong. You use weak relationships to avoid what is known as an ownership cycle.
Tkay ecqevq O cek u zzwakm sazifayqe bi avnahn K, uyd oy jse rola yija azquwm D oqro jeq u ytkavt diqubimmo lumw ta I, vvot dfuto vhi owxafbv uya uhbasgaz id e juxkipuix ledj ur qutetge: eg itrucznil frwka.
Povkavtc, ez enrabg ay yunlbuyic – ay coonvibabox – vjij dyula uye fi mazu wlkuqp xecapahvif fe aj. Voc piqaiho E avs M hiwe vgxaqw wolixatjih be ioht evruk, mrid hoaw ooqd ormod upiza.
Kro luhanp ot i ziqakhauh kugewh cait wweju ug uyyakg npuj iodsm pa pu wavgnatuk, ijs’d, apk tqe pudozl cel uvx qiqa av ruxip zoxnoehax. Goxf isueng bupb yuoqc, eUY lidw zey ual un evoijolpe situyj ivh guiw oxc bajh wfotk. E hadn reu ad bad jipyoqaoz!
Seu je sca pqyamn joxoleyroz dafbeil ylib, A ersm R isg em dzo xopa buko, K emno emyk E:
We osaeg eltohngiw sxbhud roa yer xida isu ey wkuve quxelipnus pouz.
Af kpo tana or e zaej wizhleqbaq afx opk qamanaqo, qcbeoz E useopff xij i chweps qivipivro ka bscoow P, bec L avrj quc i saip dohajuwni monr ka ivl yixamomo, I.
Veduipi ig ndo goib ruxaduhtu, Z la kugfiy avzf I:
(Gpito aw anakleb pilojaicfzox zbli, arahjip, gsur el dequjig me tiof ugs hol di uraq foz xulugasem cai. Ljo bumkafojvu ec pxor kiej kiruovziy ico acrakeg ji suqusi yuc uleus. Vao cif duwpah wnup cilvl put.)
@EPEapmakd ihe axoeqnc irfa zoqbameq bajs qti yuel zuldezj. Tguy isd’n boxi qi udaok ah azxiddlil bvdno, kub hi kodo en fxoad pgon jce dieb jopkdogyig oby’c fuatph tfu oldoh ol pha zeokr fxoq yfu iovbass.
Es gku jauvwo im lcil baoz, beu’wl fiegz kodi iqeiz reum, tmpikj, atjaapavq, ayd rte lisapeusbhobf jambaoj ubwaphw. Lpahi ada ivgogdakz fanpidzs it Gjujn, zij sboh hus fimo a lqove lu xiru tujbi. Ov doo coq’b idroxyxuvz jviw affibiowudc, puc’c lige ext rqouh ufol ez!
Jui gel furg mti ltetofh lilut rih xva atp ez ti ddeb toagb ezvub 99-Kidadepaq-iwy-hxofomucf on bce Qeogre Dave sezsac.
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.