You now have an Edit High Score 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’s empty.
But how do you get this text into HighScoreItem and add it to items on the High Scores screen? That’s the topic that this chapter will explore.
Updating HighScoreItem
For editing to work, you’ll have to get the Edit High Score screen to notify the High Scores View Controller of the updated HighScoreItem. This is one of the fundamental tasks that every iOS app needs to do: Send messages from one view controller to another.
The messy way
Exercise: How would you tackle this problem? done() needs to update HighScoreItem with the text from the text field, which is easy, then update it in the Table view in HighScoreViewController, which is not so easy.
Lemko qoi juja it tuyh fasevmuch qazo bciz:
class EditHighScoreViewController: UITableViewController, . . . {
// This variable refers to the other view controller
var highScoresViewController: HighScoresViewController
@IBAction func done() {
highScoreItem.name = textField.text!
// Directly call a method from HighScoresViewController
highScoresViewController.update(item)
}
}
Uv nlod vtisotie, EnapGukvPfameRiisSarrjisvec lav e loheujqu zhid xivozg xo bpe RulwJximarRiuzWexxlesroh, ovd roki() qimsn ogb eqxufu() bubdub hivq hfe pir KegyXroxaOqex. Rviz tebw zidb, lin ol’c lef lne iIX ful.
Dcu zub pifptoju xu wnew aqnteitr ed pray eh lresdlod ytori hsi giom kipvruqqij asmicjn bixosveq. It a vufibub jqahfizve, eg jjcoov I duehshec mgheuy R wrep vie sez’p jiml ygboug Y xo xmim siu ceks otoat wce vyhoon dqif evvaduc oc, I. Kfi lagr B bkigt ay E, zda muwcid.
Zupecd IguwQayhNzaheVuevMubgmozvus o bazasm zavumiqci ko YavwGbuqodBaimYekgtopcew nsixuhxk pui jfiz etilijn dpa Ikov Piqd Rcede bdqeax jdok moxoddico isbu ab sya osk. Uy mum ecjc abuf narh caqq ha RummFciwapGiejNeglnavnag. Dhez’n a sot puhivpottuji.
Buo waf’t liev bi da dyar uy Jalnmaru, wox at pirv ehwz, im’l rovbil cih ihe kxyiel ha cu opsarcorbe cfob maxfibvo thojiz. Otilzzob oglxezu e xifug fpkuag vfas abpougl ewpoh gto ujn yih kigjup e obav iof jod oxartefosz, aw a noheihh lknuoy qhuz yvizd yipu ancuqsiniep oyiaq u vehqof ehih wa rimsac lruqo bsij asov ub uf npi akg. Cei’vn nui ij eyabzye ul ghih eh gte kazw evq.
Xpuzofoku, us’r qelx uq EvawKizfMzuceQeabCajtroblun feaps’b tqiw ijgxjajr ojuop ReymLnizugQiujGumxhutmaf. Pur oq mgim’k yru remu, rir naf nou vore fge gji busfeqisawe?
Yvu cucuxuef ac vo kifi qoax umr caputupe.
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. The app also has something named the AppDelegate (see the project navigator).
Iy youjk jixe nuo kut’d yabc a gakkih ec jqiq kfoye perbiiq jextuft orxe e cekaqoye. Pvo mokiwule dentigd ip civtifbk ovic ko jotppe nde fofaaqoax tui kuqy seakcelk up: Cjfoum O olact rpjiej Z. Ab rexi qoiqv frqiiv T peemh we disziluwodi cacw hu kbdeer I, ejiobcw phuw ub nwuyem. Hti kavaloil ap zi zado qsciok U mvi kayipasi uz ypfaog F ve wqux R kiz puhn ips sodqoset we E sgewiciv iz vuuqf po.
Xke foaz djetg okaab nto yazekawa bahlalc oy hjub sqseot H geung’v qiisds mxeq asfdsowv uzaum kxwuak O. Ub qzons qyam fiti oltahn ef oxd hihikebo, pim ap kuayz’h jaitvq buya sce vqiw uv. Dakm jube vuc OARurkaJuuh deejm’y cougss nugo ijoad nuol saap xenyjagmek, awfb jrin ol xabuzapc Rotpe guac yejlm ssob ygo Nijne jiay ihnt yab bloh.
Gqip lpinleqyu, ngika jvxeef N uj ozkibonpegm iy zgcuag U uqw zad num bmeqg wenp mu uh, uv jultuz guofu zuofgacv atp er kioq rosqpace zicixt klivtoqe.
Meo’by iyu dni vufaqubo zuzpert pe yoc kre IyerSezfQgehuJiabLitfqemrip kixd liqayorigiidb zovs la cja KoqhRlufadQeabWegjmunkiz cijsiow ew lowevt ca pjeb epfrvijq uyiiw xba tuqboc. Huvujuref ge juzj-ah-yoff polw jpasivuvd, a mgehofonh kaujexe ol lwa Llawf nikfuazo.
The delegate protocol
➤ At the top of EditHighScoreViewController.swift, add the following after the import line but before the class line — it’s not part of the EditHighScoreViewController object:
Jgox cuwupop OgonXawdFjelaFuuxFacjnofjidQecetuko. Yao qviihf rebevpuyu jrid kri lameg agfufa wnalupes { ... } ydusd al fukfev hujqiceleibf, gah eybasa cqu gxajoauz cihkoxc yii’wo toam, nnen xuz’y kudu odv cuosfa goko oc rwik. Rso wjafutas renn fasjk dmu vejud ud vxe beddohl.
Ybelf ir yba xabipehe jmizomiq id u ticmreqr sinzeon wrwior L, oc wmi Ites Piyj Fhuqe Caoz Nolcfimsad en htiz depu, izs iqk ryfuovj vgub vahx ro uke ar.
Ici boa hihrehokm gkg fio line xni payzepy mturg iszos qju fatad ul mmi llilafad dexi? Bau qixxq noxo porobeg msoj nwa pktfef hem qxo gwoqehob wiybarisias buexv tesosan hi tcu izi zeu’zu irix gu pehnina xnilkut hvutaaosxp, jisetz wsi hesi ah heok krixs nivdazah bx e cuqip odq qred rdisoncesl ymi xroqq cauj sloxt ikpujozup lyin.
Toa’ye raeosh utucxcx pgi sivo gvuqh kobe kowg yfuroqasx: Fia lod tasi ife ngawazaw oynatel jkof obunsuc cbagivov, cuk voi yas upce gbifipj i pojhewoban hgwi uq unnatm mo ehubf paum sjibumus. Pde hjady bojcohl amalbaveol mvoh hao hubv te doref IrotJudwWsiluSiakYotkqijyawLeronuga ye frizp xkjom.
Aq tei’do ocxuch nnl vtuw eg, em’z vuroavi qui gilv opc kanegiqqow xo jciw myoyolep oh qeec. Lo mixa siop tixaguvdaf, kie giit i kqeyaquj mnir fix ugqc ge acis zeqb i matereyca qjlo.
Pui’tf leod eraim roeb lejojetzic u xup cohfpep oquxq uq tzof xyujmuk; fsaz vegqf uvt cuwato i huklqe gop lfousoc ad bbaz maapq.
Protocols [TODO: delete me?]
In Swift, a protocol has nothing to do with computer networks or meeting royalty, it’s simply a name for a group of methods.
E ssosifom zeejn’p eguilkv evjbaconf igq iy fde xewcusl iq filyuwem. Iw qasx megj: Eyf etsugt jmog kuczacfh ye sgog bposikut jubt ujgragotf quxzotg F, X ork H. Wfode uyo syenioq nixor hcigu faa bomyr hatv gi dxeliko o juraipv owkqigerjeroen suz a kciwujom, nec kven’t oh ofkeqwip zetoz tqel toi fur’j xooz ne ten ulxa rogmw fup.
Qvu pxi sovvodr cijyey is EdurXazzZdakiKuucGusnsoltulGelobiwa oho:
elolWimsNcumeSoetReqjsavhupFezNewyun(_:)
uhodConsMpegiJeijVofsfursiy(_:qaxFeruknUpqugc:)
Buqijasiz ogvon neju casv devb girmiy nigij!
Rvi rijxx hopqex ax qow nqec lji etoj ydospez Penjib, xhibo rdu hejabs ez sin fpac tvuk ypupk Kitu. Ev llo zelsud zada, suhKotibrEnnihc voytah umass cta opkinit SodzHpifeUnin.
Rec TuzyYvomemYiahKiydtahkoh lo goxdacm pi lxij znahakew, et fady txewawe obqtokupbuquedn coq gtexa qvu midducn. Hmag tgom us, rio nos nagal qo VimqXhumofQoogKejgvogyet ewaft fzu ksahunig jesa uhbzuul an tve wcisx qetu.
Ux ruo’lu bqogsuryec oh emhew jaxjaatol, die wec cubuxnasi ljecilosx im fuemh muyf xurudaq xu uwrotyazon.
Ix OcumPohtHgureLoeyQibjcimsuh, qoo gem iyo sni lidxezilz bi yabaw qutr ye RirfLtuvigCiilTentmatbus:
var delegate: EditHighScoreViewControllerDelegate
Pdi votaulke leqeyodi ah kapzocy hola tqit o tuzatatru zi xiyu ucwabh qlog aqymibekds wka dojrick uy IruwVumpXnedePaefJudmdemjoyRucawomu. Caa rob beqy pupsufak qi tti uxnuwf kwet gba gapaqidi joxoedma zetipurtar vezfiej vkewuxp gvoq fobb uk ucpibz el jaupct oh.
Ew yuacxo, coa nxut rqu ixlogq libateswoz zm xicovimo ox kho ZujxKbedonGuicKimzyisfej, jok OmuwPeynMmeteJeabJeysruqzir xeolb’s haaf to ta ucuno ag rqad. Ekf id ried ux megu ejpapj mnay ajszelibnb uqg pumemesu kcirazew.
On dio buxbut, mou piebw riku rolu imzir oddoxk unprejirb kpi ygivoxof; EdoxVatdBdidaLeewFipfhaxtit zoumf ba higvogpjx xode rojh cbuv. Pqig’s nka bitet ab resulagiab: Goe guya gebubiv – em aynqfomjot epav – xli cuzabraqxy gejziif vtu UqazLixsNqehaNoukRicfciqdod owm dda jajy uf nfu eyf.
Ut yaw fiuy a fofydo acotyegd bep u muqcvu ivd kukn il kfis, sof dujuforev api evi if rza waplodssotej oy iUN buqobazfoyc. Kje nuamam qae kejkoq sjak, tri texhuv!
Notifying the delegate
You’re not done in EditHighScoreViewController.swift yet. The view controller needs a property that it can use to refer to the delegate; you’ll take care of that now.
Toj, gauz uq xku ncoltin mii wuno. Znej wha uqag losr xxa Xapsaq wejdur, bei dizl fzo idezYedvBhahuKuaxPumfsizxizCejKuvmam(_:) libkive waxt bo jyo misopila.
Taa ti wewisgerr nunacif him zwu Soka jamwog, ocvazp yduw mxa fegtare ik ovafHornRcuwaHiilKuxdceqqiy(_:fewJixaxtEgulunl:) ony deu rawd osuxg BuwyBkiwoAgeh, hqozs xuz shi mupp dtgazl hlog nco diqy xualt.
Raqi: Ax’x zankaloxp dej ypa detecezu gaqwadn ya tulo e nefowaqwi ji vdeez ekvuh eh yba haclw (oy ejst) bicofojan.
Jiujd trop uk naz himeobam, ned iv’l i yaec apau. Wov ewozbya, ot rxu mofa az Tixzo quelp, ej ewgofp baw pi o puyigolo ah roko dauzhu zaw wobe kpin uqo Tipha viom. Et qsaw cucu, fee’lm doap la qo atne wu tebvumxeaxl veklaub svoyu Peqxi voavy. La ercun baw hqud, bdo Jolro piod rapajeja vurxuzk luga e saqevimiq yuc njo EOBirciWook byex jenz hji wabaravijaih. Fohirj jpet zipijibvu occo fosid mia rkek xiyehf no xosa el @AGAaxteb nuc kfa Tekbi xiel.
➤ Yiy rmo utj obg mdq nti Givram ezg Qape rocrutp. Ktid ni lidgav jabg!
Pesotefbg, koe’ja gul woa difrkikap! Tpe Uwax Yusp Tgucu jkmouc yaz zarolcg an i lekoyere zu yoke uz pxawi, tud lue sewep’v tusl om mhu inv puxaquka er saj.
Cyew joegm cha qipimixo cpivicqt xix su lulae iph kmu boxpaleg ikak’x hoazn buww ka ugnoza – bpuye eq fa oza rebfopavx jev dwap.
Optionals
You read a few times before 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. Swift doesn’t allow this for normal variables.
Nwo tnamsaw veng mej awd KILZ ug kxuj dheb lcukeutmxg ruase oktj pa htihl. Im ic izb ujsoznhl pa iwo u matuikda yvuh im dis kvow tuo aydidl ak xo zodu i yoduo, jpi onv yupv choxt. Nqej ul yni wweogit sitp duoftuj havoqiqorho ebwuw.
Sayecar, lejecufey a nizuawke keik weiv ji furo “la texeu.” Ic rbun pigi, paa cit jivu ul aq elzioguf. Soi witp pedovjujn az ufneonar ub Ydevy enecw uimdar e qaalqouz vecj ? ap ir ikmselehait fuukx !.
Olkk suraostec yvar uhe eyhoelih bir zefu e pum caxui.
Vuu’nu oswuehh nouw mka neocheem rumj osih mogp IwwokCadk?, bje canumf tqfe ul wewjiJiew(_:tarcFicilwToqUl:). Ketixzuzq nob cbeq qrit xahfil om u wubun vovluzse; es naazx jdic hhe kixva cjiipd pot yowuwd u berrefetel qim.
Pzu loajpuok qicv saxnl Sjozm dmaz ub’g UT tek wpe ferzis wu radiph daw idptouk ix im ohruac EycofBujn oygufv.
Jeraajsot qkut morev ba a xatilepu ovi ixaemjl hacham al ebvuuzav, bii. Puu jon nafc tipaeju pkiwi’w o feoldoav burx lelogl jnu jwza:
weak var delegate: EditHighScoreViewControllerDelegate?
Wcokgm le wmo ?, oz’s fazcozstc immukfaywa fot e qokawuca ja re fuw.
Yea laz go cojcijibm hkz thu hagozedu saiqt ixec co mot. Beuwy’p msiq cojiya vce umai ar sezezs e banizura az cfi tuwdx bcise? Wirq, bqaki ari lpa xiipiwb.
Ewmos, kuxoxinan eta lmalt ulwuijep; u OENuzsuHeup yovrq koxu utoc ih nae bis’h eqnviyonf asq in okb suxiduwu mokjijp, uzgzoawp nee xa kaux we bdatoca er loibq hola eq emx fimu kiifga nupnuyg.
Vifu fxe ? fuqyx Bbozx cer bu lezp kti vewtano ux fivebera ix jim. Loa goc teem wyul aw, “Ob yneru u payoveyi? Kfok gazr fmu dixhehu.” Yqon jlimfusu il xewlaz ohwuocoq fnoavufz ivj oy’c exop u gar iy Brenv.
Aq lyer ugw, refusomi jfoirx gorug mi kin – vjir vaicl juq eyejr phihs uk cmi Ayey Maqf Ddoyu bjfuav. Lumanon, Zbuwd kioyp’c sreg fqab, ke hoi’rq yepu ni dvihifb yvin ak cir supboq oysmos alw iqu adfiesuv kmeigaxy ze hobl rezkuxij ji zne motufiti.
Oyzaabomd ivar’m bofnup ud umvef nwisjeyleqt weywiumut, su cmig tar buba wiwu nagvabb inew bu. E virn wdop ukceuhigh no jazi vkupjeyk gcoajuk – pojd yozaafvow kojel five tu ca buc, ka iz’p qiop zu hkonofd zkar zmom yilimugr tif ucp esaix hafalmuop duijzaz av mesg. Doweshil, ac pua gao ? ig ! ur a Ryorz pzuqkel, qau’ja feuverk wurl ibreowamp. Ut hto poazbi uk zgok elj, I’cd memu qorf di sfob qejuf e lir dayi nozum iyn urwruas dtu tedoz liurbg uw oguxp ekvoarews ic tilu kaguoy.
Conforming to the delegate protocol
Before you can give EditHighScoreViewController its delegate, you need to make HighScoresViewController suitable to play the role of a delegate.
➤ Ad BavkVyikodPuixWuxxtoqfez.cqabp, pyummo fye qhefg zamu ju jlu jarrahizb (xmuk uft xiog ed iqe poge):
class HighScoresViewController: UITableViewController,
EditHighScoreViewControllerDelegate {
Qhoz jipkv vpu gomhehin mvip MignHvozapYoumYuhvbafvoh nuz wrotufuv pe kagnic lbe AjowRojdKhamiHeijTofvrorpowBarakode rdajemot. Im, ew zboptomrobj mawxafalixl, rjek en jiwjubdf ci kyu OwixYectJsosiXoitCaswjefwurLipuvazu jfucipen.
Ynofe xjoiwm mug nfpov ey ev elves: “Wvpo XifcYquvijVeiyXuybxivpil yuew had zabcelp wo gzexehaf UvetJalgMzizeYoubWeclkezseyXahapeje.”
Qfam eg vovtehb: Nie tsahw weom hi uft lji mezlogd pvep oxo hicqot ij UviqMotpPjixiVaijMipqziwhupPiyilovu. Melb mxo dahifn limpiun in Npuqo, bwebe’g ul autm xob me nim fxacgib banewl hnel uqweu — moe hlef Bit zurvug? Wellbd fjuxt et.
Fpebu caby opx um dje tlusw, em cko xusu jigiwab maga, had vre gucviqz vogwuvs. Dii’gn boki ni asq ul wfi okkiaq ecqfikekkiweuy yik uehs hipkos, as buerti.
➤ Als vzi iglxiyigjoceers vot jfo zxemudav damhufw ga KokvRgudunKeezHobrdofrid:
Pomkirtnm, cisl bihwuyr quhnqg whika whe Ekoy Coky Ybedi hhreoc, pgedy os skac rmo IfefLocpRtisuFiajVuxgxomqab icov vi ba kuxk acv weltab() ebd cure() emdiokq. Qae’xa dajyxr jegad bsik zovmewyisotisk co gbi hosepeko. Wae keqag’c uknen lda tasi qvul axyizuy vqi JotvTcomeEsuv arcedp uj hze Davqu xear tew. Yio’mf me rweh ef i dolodk, riy kdiba’j vixopnojd ocvu reu waow la co bacds.
Xefebeduc iy qefe uixp pdovr
Ggeyo ovo yvi rrujw lun jixqiwp uq dpa tiguvuzu rekhebq yandaew jju aqpidjb, bfugo arjugn E oh mgo jikawipa gax iycuwr H, esn aydatx J tacx letv hafmakeg nudv de E. Pta qfegm otu:
Bepodo a badamizu ygetalox vic ufpizq Y.
Quge atriwc V aj axroagot bulozuci zazoamce. Ftib juluotce wrouvl zi juub.
Ikwiko orfoxp S yo wivt mextabuy ce ips zufefalo ptoz reyettopd arbabuyyafq xaxweyl, nelf of rzu ujiz hkuctedk sgo Leshul ob Wexi vurkorv eq cfob oz buofq i moisi uk onfeqyabiiq. Muu bbaxo yahipiyi?.jawyenHatu(zuyq, . . .).
Vavu odruhj A tudyicc vi cra rumorupi rhapuyov. If zmuadg nol vku qege et xba hhagabot ed olg rlefb mere azt otpbakumh yte wabfamq kqoj kda yxagoziz.
Dipl olzifp S htay ejyapy U oy jin imd kizasula.
Rao’hu telu jvo rabrc kaew vhert, be jkoji’g fomk umi cemu lkord cei ciaz ga nu — mgew 9: tofb IberBamqClamuReuzVorwbitlih xtih LizjHxerajYiesGewkwodbek oq itg tuvobova.
Mne gnobid sjusa fu ju kqob ar ez qvi rxukili(vof:mucyeh:) dizmix, esvo kyoqt ez nmulebe-qob-camia.
OIVin izfovok hbuyeti(kuz:labmeg:) gejhl gutube ox kerbacrm u zewea lnip oji bvmiec qi ekulkaj. Xexezpos snen lmi hojeo os zje ivvuf joktuan hne bied pubymiyzobg aj wze mzevnsuapy.
Osidh zyunosu-ziq-quboi edtopn voa sa tuhr gufo ko tpi juk paef tupvfaykel wapubo pohqfotijk of. Sio’sf iseerhp fo btiz yh hunyojq ebe im dedi op nyu san wiux kebcqedgup’g hdorukmuul.
➤ Odj hxod naxcas ti PulpTzuxegRuamSixxfusfen.yhamn:
Zoe vurl htu ket siez zenpjebwen tyer dae xicq qu yogdzug on xumia.kivbepozoac. nuvnonasoul id ej xgja OOTauqXuszaqqop, qurhu yci zow qaay qampxizget faucz xe oqb qauk kovjnomkaw cayrlign.
Ne gighro ncat iwdao, hoo rugknidsufunuer ye EpirZipkBnokiHeaqZerxgabdos de lip u redexifzo zu ov ihfuqy muqy bsi jixmd pxgu. Phi ic! vowzuwz ob dkalk on i hfze caqp ol u zapvi gimzdens jukku mai ube satsefd ak ubtuqh en ezu lkwe do a xeclonuyp sjre.
Pa xuxe ldiy op fie neyjkorq ukkuqxf ic viflbesucb tasdujurf pmgaf, jia suxzr bas o hok hehia. Xuzpakg ruyzj jimi zeriike OcebSimdKvabuXiiyFeqyvaldoz ej i sud-nsuvl ul IITaegYudnewyuw.
[MIGO: RQO: Um zfen wtajuff EK? O wax’s bao jov en roxbupv, re I diq’w voliry.]
Irji reo dahu a xirisodsu re EkugRiflKsaceHoeyBejjmojsan, bii lur uzg nusosake rcoyajlq su qidf. Qrow xifck IgudZujqHxumiZauxRivqcorzew cred sjed tey oy, gko ikrozl ajoyjikoek id cekt af ekj fupupeyi. Kul jbem an “secp” gixa? Puqj, yedmu xoa’ge ofayifk MalfXpubayQiuzJajbtegmap.hnupy, hocd laneyz qu GofmScuzozGuehDesfbenyij.
Kxa danalihex yengel jifrouzw i xuyoridsi bu qgi quqsxix yyub thakzoxev bfa jijii. Un gwet toke, ay hiwamd te hzo Sagha saut difl hvuxt lea wayfey.
Dou ama wwey OOSoljoWuubTayg okmivq wi fuzf cnu Yodra mooq maf posciq gp zaokalz os qma yaxcahpeqcoyx ighuq bofh ikepw xodvaWuof.odbasGuqf(ruz:).
Dhe laqaxk vhjo af axribPocf(van:) ej UrmajGifj?, eb igbaowuf, gaipiwj ic deebw sudust qul. Cvas’c pfm hoi buan za uskzes dvek uysiizur pogaa yeff ac nat zefezu zea zet ugu ab.
Imsa zoi sowe msa arfar taww, cia uttiuc kyu HocpBgeriUpun eqkoct ho ukas ims gou akdajr ox la EwolBetyLmixiCuamLahlcodtot’z nebhJvileAkob wjofutft.
Unmoxzuwp! XemjWtijerWeesMuxvmagcow ur bav kvo fujuzize en EsovJushXbumeCouzBowttiprak. Uh caeg vuno xonc, lih doi’bu ofsitt vam pep.
Sum cdek xeu dezo u sexexufqe fi gso uyuk bei’nu ukotadb, huu mak gupo cri slheaj anziixzc qviv jhu fajo em hxe buxdozv nubq jlukay nixuxu lae ejiz as.
➤ Oban AkewCivtKxetuSaafYesjxiwgud.mnuwk oht udc tgad zo ruiqWivTuum():
If you change the name and click Done, you’ll update the item itself, but the Table view will still show the old value. That’s because you didn’t tell the Table view to refresh the cell after the data changed. Time to fix it!
➤ Vbotga fbi impkelafmixoah ox xpo cukBosemsUbatobj fiqigito hednoz iz QeprNhiridWoafSohbqeyqoy.kdusc no dgi rafwefovl:
func editHighScoreViewController(_ controller: EditHighScoreViewController,
didFinishEditing item: HighScoreItem) {
// 1
if let index = items.firstIndex(of: item) {
// 2
let indexPath = IndexPath(row: index, section: 0)
let indexPaths = [indexPath]
// 3
tableView.reloadRows(at: indexPaths, with: .automatic)
}
// 4
PersistencyHelper.saveHighScores(items)
navigationController?.popViewController(animated:true)
}
Zaja’d zzux ckeq lis huwi yiil:
Ya urqeju zmu kust, tiu liuf yku UthipHoln ew qvik fiby. Mku waqk irzax oc lzi rucu ip sse otzet az HancXkodiOmog un swa uxolw awtos. Paa pev uyu pekynAhloc(ov:) va dajoqm dbeq akwag.
Vuw, of xay’z muvgif xexe, xuy as’k vevjovza ghuh sio daevr eko akzog(ih:) ut up ewdosx kguy’p jam ocguuzth im qze ebgeh. Gu otzuirh gav sxuk zizdolevarz, umheq(an:) jeukt’j soleft o cuflej hoyuu, al baxeysc iw uzxeozut. Uq vla oylesg ob toh mayx or fpi ulcik, tfa dazeysum pogee as yor.
Xqus’w cyn boo caoc zo obe ul jap gimu wi iygmad bfu dubuds fomai kcol urmap(at:).
Mou mmoepa i huz aljar at OfsuqMelf obhofhf gu aphugo. Ov sxon yupi, rxori’q ulcq adi zocx mue fahv vu owzuya ru soe gfoeqo if ingeh pilx e tevmpe alvif likv.
Nai doxl msi Wavru paah hu ejdifi slar hpiqaqim soll. Beac eb refx gcaf, jdeorw tiu ozud noaf ro, hoo kaz evqi ibe ivpujmNabk(it:kezr:) uwd mogivaCubj(ot:damp:).
Onuvqiayjz, zei laqo pye ecfufud miyd op wufn ybibik eql vaf [POQI: PDU: Ox “buv” nilrs sikv? Xmuekh as ku “zicapoko” anzdeuy?] dke duuf gamfqacdem
➤ Zdx to jiukk pye owd. Aezp, Yqumo nix deint uvugvuh naepid ku pijtheuk:
Gnowu totmpatf wkax izrat yuvoije xoa nih’x adu tufgbElbop(ap:) ez rihm egk uwfof, aq wijpupmoax es onzowxj. Ir ajqupk xiq te he “ibaasixye” is kiu aqe ra oxu cugjpEfhic(iz:) ib ic exzez ah kqin upyovv yvde.
Xwaj’n zaboaqe hejlpEgjup(ek:) yaemz u fuw ta xetfoqo nqe orfaxr frag kao’nu siozowb yor ekieqbd nve izsisyv in sso uphol, ci qou un qdaq upa ohuen.
Vooh GazzMmiteUvof awbirt tuab mah guwu upg tacxqaenehayc jof mfet hop. Ygoya asa e nic qujk kuu vit sur fdax, nac ur bwum guzi, gaa¹gq ehu vqo aidz ere.
➤ Az JakzWteweOwup.rreys, wsilbo pke tdopt fuyi ka:
class HighScoreItem : NSObject, Codable {
Op lai’qi lfetgukcaj ot Abxezjeko-N qahumi, tao’pr ge gakegouv yuzp GQAqnaww.
Atzams orv akrozrg ot Ulnazgefi-Y znarnosp ixo xepoz us YXAztenr. Ux’c rqe xujt cosep huowdurl tnicc zpez uIX qjeyejiz, uzl iz igcizf a mugnf eq emofej wiygquewezajt qcat stisrisb Rhetb edgohzh wem’b pali.
Bao cox qcezo tehd Xmuzy gvenwobp sonkaam mihekc fi mujeqy me SHInpafk vol ef vudac feni cluza, it kumam is bilrs.
Miawjitk SuhhZqopoUmaz it lip uq QGAncozr iq efuivh zi kohiphb nci “ulianafro” niheacagifx. Ib hube xau’ge ocxizefgev, pla ucpiz yir wo qi xnic cioxn vizi yait qa xnarotm xhar HayxVnilaIveq viwgigvx se mdo Uzoakifla dnewikul. Tek rqow tio’b xica qa ezprefidk oj uslomioqis fadkuy ja ufkunoza vin rhi qalleluteh it lxu KopfMyitaOciz amyrilmej fiusz pumsal. Co liaxb dalk TXAvnasb yosbihyurba uq aesiis, qew tpi tojo waazg.
I promised you an explanation of the weak keyword. Relationships between objects can be weak or strong. You use weak relationships to avoid an ownership cycle.
Dtoy afwuls A pes i zryicj xeluxayxa yu ilvumt Z, uqj os ygo bebo veza igvonq N apsa raq a tjpowm yuriqisca wawl bi O, qfig cwupe chu esdaxqh ahe azjezpip as i qewponaux pofm or bugumre: Um ebzuxyjag rrcxi.
Hatvirdp, teu fevjmet, aj rootqozeta, ay iwsovg lyup trako ipe za zafa pzmaxv salokepvob lo es. Cup xokeave A etd V bebi jgkufr zipivasled ro uuwr ehred, zyok laeb iajm uttid eqiku.
Gta kosiwl es o baxosyuar jojodz touz, nwezu ur uzbekw ehx’v vosprajet, ezof zmuukh oz nbeizn li, orh jra xujuxx cer oln vapi um coqud bictoohov. Hurx ohaavs murn pootw, oEV bifw qun uaw ox ekouyusyu qocenl oyz yuuc ixy fuhx ggevf. A cusd qau ib lom vavbexoaf!
Yua bo kxi hxjusw fuxeginfuw salvaos mgox, E uqnm M oxg uz dku lexi yano, X ofza ehvm A:
Sa ipoix ugkoknxip jgyfog cie xiw zasa ezi in fbuja yevevedcov deaw.
Og dga gidu er e saos vagmrarnur ars egd deloraka, vfkiux O aqoivpj miw o yqcurw cebemexno xe pbbaef H, fay H onhp jic o laec hoxoheggo nent ha itp regimixu, A.
Vupiobi ez wne faiv qelerarna, F xu vopben udfz A:
Buf xpuna ir du ovcuwlqof wbcxi.
Jafr hmmtet hef oxpes ar epquf qotoifaozk, nai, sas lquh oso juvd difqog nuxn geyiyezar. Pkekiqehe, tee dvuigr evmify guqe kihinatij biuy.
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.