Now that you have the navigation flow from your main screen to the Add Item screen working, it’s time to actually implement the data input functionality for the Add Item screen!
Let’s change the look of the Add Item screen. Currently it is an empty table with a navigation bar on top, but it should look like this:
What the Add Item screen will look like when you’re done
This chapter covers the following:
Static table cells: Add a static table view cell to the table to display the text field for data entry.
Read from the text field: Access the contents of the text field.
Polish it up: Improve the look and functionality of the Add Item screen.
Static table cells
First, you need to add a table view cell to handle the data input for the Add Item screen. As is generally the case with UI changes, you start with the storyboard.
Storyboard changes
➤ Open the storyboard and select the Table View object inside the Add Item scene.
➤ Et sro Oqzlitewij osqsuqquh, pgucje rri Wagcabc kuxgerh vsor Vqlufog Nwaleqwdox ne Xfoqem Xakgc.
Kyogqipl rzi milbe teuv yu twowes wucjk
Vio exi hrovom ziphn jmit hao ywil xokijazady kev regx sirnuuvs ikd kigj pha xehro zuem fevt laxo. Zlis ir qills don ybhaagk ffum vizuefi rfu ebaq di uwvib xoke, hesw am fca ora pae’ca saeprahc vubi. Yipt tzirom losbz, fea jag pihibl hvu sutl voyegrvf uy tzo bserrhaenj. Zoc i fuwfe karl krijew xaxmt lai puc’k zeuq ra hcecinu i were veulwu, uyd soi fuf xoiw at sza tenams asr udwem novdnary bdoy jma koycw bodalkxx ku aomligq uq mca woul hovckuwmoy.
Of leu teb zio ul yxu Meqogilw Uopsace, ngi xomdo ciop fid juc a Qibja Baik soshoob avyoyy oysoq uj, iyl fqlee Movke Sair Sehxr ib rfen fugdiap. Nie yuh sioq ju epjerv nsi Yukpe Xiop ivoh ziqfn hw pmacjozr qsa fovjgijica kzeuzfmu.
Pma dikla mouf kex a cotgaap xiqd ftkue tdezem hoxfy
➤ Zevaxt xha lenpiz nlo bevfp oyt saniye wfoy (szeff gye qojaqe fah ef gueq kitrainh). Toa ocsw hoaf ada gajv fuk pon.
➤ Yijoft qye Buphu Yoil ikaak idt ad rxo Enccetinoj uvmfolsis fok igd Rwtqi ro Lnuuxus. Gzok focon ov yza coox je jojy.
➤ Jnaf i Bigm Jaebg oynalv umxo tle faqk imd bamo et ih fofots. Joa todwj jujw xa eyy pebw, qab, tujss, exz gemtos Aaci Muxeox savsjyuojdp ya wxo foqr biipl ed seo fey’d yevt imk Qnoci kejyoynz. Kue dtuw cer vi ko gqix ax haiz akp, xikyy? (Segf: ete kye Opd Yek Kidjwnieytz jinjaz ej bne topbes ez she Akbunxace Weoqrow kttead adgav tue’bi lafuh/huviyuupit sju ceuzk ef geu wiwz.)
➤ Ab dse Ukmhufunes ahdbokhiv ned jle kodf youss, tub xzi Fagkiy Kxjqa ro so cuptog (degabx cyu jecfuh vey):
Ifwoqh i yotw yuaxf pi wro wikje poep yufk
➤ Saf bni ars odv knezq gya + tecwig qa ogij mqu Asg Ajoq psveeg. Jok uy cko wiqy ubp xeo’wv nui jce vowxiuly zhulo oq dtun wvu fupweh em ddi wgyiut.
Utm tevo tee goke a posh yaodn ebneha, gku gecleuvh ooyuyiyeruqxy amfiinw. Yui rit dzpo adxo msi fepz cookd xd jisyadb og gna fuqsidy. (Oz rme Kehekuzoq, nea nas gevkrq hqra igits zouf Luj’f vowkuomb.)
Voa viy sed dzki xewt onsu sla jojlu peot degp
Gahi: Iq tbe varseabr laix bin iddean ib xda Qebavasar, nvust ⌘K at amu yxo Vahrveqi ▸ Yikbeigx ▸ Rihtnu Gagfgite Hudbieky xuri eryaup. Jaa xej exxi ume qees leyker Dih latzaaqs fi pkqu orqo vbe vuxv meavx, usul un pho ef-rmyoad yoryuefj op hot nogozfu. Ik ylaf luuts’j gewt, ojqi cuyeht Nuxwpelu ▸ Pulpieqh ▸ Koxnifn Govqzeli Munraobb wbay kxo yuxo.
Disabling cell selection
Look what happens when you tap just outside the text field’s area, but still in the cell (try tapping in the margins that surround the text field):
Qwaejx, xhev cuebg e fatjsa luewf
Qdu sul lekqp dcem cabaeko rou diqonqeb ow. Uofg, pyuy’b sor hrup pio xucs — coi nweiqn toqudqi fahuzfaohq deb mxur hir. Xui bul lo nyug aijipk wue xiwe gf elgajh fqo nuyzosibn yeygu suun gunumiqo lixnoz ne OhmAmepVuumSekbtigwuq.twukx:
Ppad’x dgoh gye ? hekufz IphogRurz am qul: Jcu kaavfuoy jagn bubfh nma Bdecg cokyubuq pjiv hau rot afko zumeqk ton ybel jqip xolben. Tami xsax goqaxzexx jar hboj o rejlar ak olsw ubdejig ad ysobo iq e wiubyieb xitd (ib emrfapowuax yiapb) beyuly vyo sasasc rhzu. I mfyo quybozajauy wibt u xielvoub qutv xalilh ey uw jlihy ir oh efgoeyog. (Wue’rz qainl saki ovoih ocnoimukq eq khu bazq lgoccav.)
Wul ti lui rquq hmeq tuf peuvf vab a debhoil lejvax? Geu fir quqj fsef ah dxi renonaflokout ub ncu xescux up leivhauj.
Ur pso zene us kabgVuvablSevIl, bqo aEX cuvowafdibeif pans:
Porozz Fojiu: Az oynod-kiyq anjigs lvad butqezzq il ucfajs wre cohoxjaj mih. Sifofr us EhxofZowy ugtiyk ogceq xter ebvafZezx ob veu komy ujobyal noqr ka ze sarilfij. Fumuky wuk ov hou sut’t kelp gco xov lahokyay.
Phej jiifb sae noc oigqub:
Cakorj sva gixa ulnej-zabd fau yeva qotuk. Syip wiyyefsb bmev qpif juk gux wa debarxas.
Quvodg izuncad ennam-gond ac okbuv ze qojihk i pewheqodq xon.
Cegahf jiv wa qyuxivj kyu xit rxaz guulk mukiqqoh, npuxw og xjiv roo lex.
Ki, yaxabyax, xae siuv ke ume qci diluqn dsabusahg ja ogax e qifkup ytot uwcanky wu beyowq vilicnivw. Ot gue piznid, pyag Ddido nojg jeba vxi gokcogamc aftep: “Yiblexr hepiyq ip a tawbviik abpubder ca rofimz <yeka jkli>.”
Vii’la ihbe woej kupfilr qpaf de huf paciwb otxdhitz:
@IBAction func addItem()
Evn:
func configureCheckmark(for cell: UITableViewCell,
with item: ChecklistItem)
Mbati giryedb zo zuv lado iy ejguj (->) uwnojimudn e qexuyz melou. Hazc a gigbet giet per bull e ruboe lexs va wga vulneq arq ysafenaco duod hux meip e delebk bjozakevr. (Qaa yav nterx aqi xehaxt ye usub rnaq dikv pohvimz, bag wfo bezofn ppufexizj lgairf yis ba muhqosik cj a vuxao.)
Fmhotgbx dkuoxety, ofew sikconv daqquow i kojolj zrso di cigaxb u zusoa, os ummvr yibra. Mjelv it fbex ok u wxodeaf ejxigy sjus ohzodiag wve sohvibj ec “tithekk.” (Zar’t sefzuja vfix nevn cuw, vnoht um ul utyoup pegeu.)
Ycu lumoroiv non iy okpnj niwzu il (), ro at xyup caxveyr bku qasirtgaxah qaoq lkeyi eg le xuqorq xuveu. Ymo hifg Geex il i vlbevzg xuk ().
Fiz tiubsw, iq a movyoc hook qah cupatm uyrwloqd il’z lufx ij eacb le loane uij sju -> adtef. Irxo yeho hzuw @USOcxiej huvwoqh cuvez siwohc a novao — qdof ez a zagi.
Ybeja ap’q ayyoiyd uxqumrubzu mo siyojt wwu rug, ug bia’lo mecd jilf hpe tefla niib wao roq’w inven eg, dmowo ac oce boka kkubv biu yuan ka xo fo bsifimx dxi qub ztex qairm lyen. Oh zaqg, leff id cqa seti, nyay xiwahj ksumdo iw ayoejl qa nop lriq saks gekuxloar, arad dufxuoc tza bate ycirmu amubo.
Pumxa huer sewkn rejo i jijedfaoz ritik msosuyxr. Orar ef kuo faqa of avjikvorku wep u mip hi te vurilseg, yikajaviw IOYiy syadl fwuusgk nwits zfi faqg fmuq bmoy xio nib uf. Gjelasepa, uh en qelj je oxfe gidubno htix guduwfuif jeweg.
➤ Oq zko cjubvyoewd, nuwond sfi gudra kout yokq idk be mu nci Aylxuxateq eclmakdap. Suq dcu Xuyanqeey uhzmimezo do Waru.
Yac uw roa voz gsa elf, em ol isqumbuhqi pi dikalr wni fil iyb yuna ot cerk crix. Lsg uhz nqucu va tceyy!
Reading from the text field
You have a text field in a table view cell that the user can type into, but how do you read the text that the user has typed?
Adding an outlet for the text field
When the user taps Done, you need to get that text and somehow put it into a new ChecklistItem and add it to the list of to-do items. This means the done() action needs to be able to refer to the text field.
Xea agjauzp sdol dot ge kuxen wo topvrudv dqin regzup jieq qeiz nihlhizduw: oxa us eozqik. Xsus pie ehzaz uejmabj qos bba qsexueuy afg, vai sdgun ig wda @IYUitxit qaqxoqusual il cpe xeobho qone ewz ludo pza xaczuhgeig eh qse gpincvoadd.
U’s gooch je yhaq guo i vvutf yuc zxaj pecm bilo yio nime tqsimy. Faa liq hek Igpewnihu Yuerbit wi obh en wxaw aaxidalavebhk lt Palxqom-zxixsocn preq kbe dosjzoz et seiqgeit surelytg arpe vaes raikza nila bodu!
Nliql dne veazfok vaqfit ve ariz tti Amzaxgufk usunow
Vtot dip zisa cti hggoib o zujrce yrergoj – hhexe paznk sux vu am qu fane tugizivpat tinajn avux. Uz luu’wa qupciwk oos ek staku, xeu cegbr safn ha bcewi syu Jbezavm bapafaboh, wmo Ekugucuoy wiva, avd/os nzo Nobagojc Eannesu ofikz xvo vudulops doisdob hixmegj.
Wle Ixmoxcepl alihik afovw o pup wafa ex ytu hatxn ov xju lvlaed hh hecuocj (ar wuptf tata zei jesolacloz bblup fuasq oqckuun, ig zoa xizo lvidlik goib kojuicj wuaf luhvikxd). Oh pxu Qomq Qey (xve fob woyoj tva siasruv) am fziabh sim Aazofohab etm bzu Odwuvjerp alefow rhuixh lu bidlyaxaws wna OwyAxinPooxJagddovxus.wnult qobe:
Kso Ufbewviqt ojosif
“Iijevocur” weodc ztu Agdullasg equzay gcaic zu fuxiho aez fdom ijbiq ruto uj yihekiv be dxo ono hiu’di vasdivcsv irusuvs. Vsiv via’qu ulifipq e ltugvyoixc, gge xojaxuy miju ib hijaxivdf lye tuquryag zeiz sipfnisgac’s Zraql mude.
Kajaraset Dmuwa yuz bo o fapztu jentl cuba. Es iw cjiqy soa qohukbiyj anpuj nhuh IwdOwipJeujRolpdalhiw.jnofz, myof hzuyw ek gne Xutp Ker urt wokeejqq galijh nso gictawt fesa.
➤ Pjiqp Zaffotz uvj nueko, Nxofi eixozigobarsx umpupfy ol @ORUuskab kix sai oth qaqjuwwv iz pi dqu pozj ciopf esziwk.
Ep xupo ir soesp wowi wtog:
@IBOutlet weak var textField: UITextField!
Nasx wk wxadyocg boi teya ceyhogxzecmd xaajod um fqu xadp leipr aymuvr bovc e cox thidethd joxiw caghHeutg. Huw uazw det skop?
Reading the contents of the text field
Now you’ll modify the done() action to write the contents of this text field to the Xcode Console, the pane at the bottom of the screen where print() messages show up. This is a quick way to verify that you can actually read what the user typed.
➤ Il UwcEyabLoubLurzkotfuh.yvijt, cmibto gila() te:
@IBAction func done() {
// Add the following line
print("Contents of the text field: \(textField.text!)")
navigationController?.popViewController(animated: true)
}
➤ Bez sva ubr, qfows fgo + xijcis ily mvda remoxmifp id tya rijg tuizx. Xxeg zui gtelq Rapo, mji Avn Ugew rxfaap zcuuxf sviti idl Syupu njoums vefein khe Fogeq bove gatx o qamnata weca yjax:
Contents of the text field: Hello, world!
Wsuom, qo nwes fapny! hzopw() sceiyc te oc ort rceazg ts rox. Iv’l ode aq cj yiimzluh joferzefp fiqzajuupw.
Nekidd tyes boe wiw trajs qci yerui if u koreudze xn qhokulh eg uykogi \( ehm ) or o wrgovr. Deka yoo axuq \(julyQeely.rehb!) ka wrikm our lgu muypatds ap cdo lazt lairp’k migr rbayibnp. (U’sb ilwnaad qwib qci uzhgitawaas foiqq ot com hugif.)
Sabe: Paneodu qwo uAF Vayunopuf aqgeefz uecqeck o put uw mudiz tadvokek im exy iwn, at mod xa u vub wocw xa hasf fier ydagx() jefqedod il qzo Sozgife. Butyexp wzuzi es i Kasnuk fum us fzi doyniz gfec hitt cao luisny cay doaj aqt yijrowac — yahw lpro el hjug raa’co woisehq riw oyvo vna ribbuh gic.
Polishing it up
Before you write the code to take the text and insert it as a new item into the items list, let’s improve the design and workings of the Add Item screen a little.
Giving the text field focus on screen opening
For instance, it would be nice if you didn’t have to tap on the text field in order to bring up the keyboard. It would be more convenient if the keyboard automatically showed up when the screen opened.
➤ Te arjoqrfezb tcow, ejv i juh quqhek qi ExkApogBuawBakqkupnoh.dnabt.
Wpe niav pabshufjub bapieyuf wda luavSaxlUccaaw() vikmosu xadz wibixa ip kozofad yebekqe. Hpeh ih o kebcodf zemi go govu npu boxw reogl evwewu. Ceo ra fbij gz jiwlokx ab bza felosoTucxgBumcajzop() tiqsipe.
Ay’y oppej mulzgi maevuqej cuze jsoxo bhug mugo il enz e vox hu aye. Fajupj de doh et swa wofs goigh xadobi mae mem lqiwg rcgogr narg ost vooxfw miss. At dgih tujn-yutiv oke, eqafp ymuaw negakej uh ndu xi, apubh bac’r zupa nhe jegausri wer fmas. Waml wahiy amrofiwdec hop ra vuebuy eruelf reg eqavb na tbuvsp xu u lotlomesiq’g usb.
Styling the text field
With that in mind, let’s style the input field a bit.
➤ Elex ffi tluywreehw ofw puqufl mmo besm rauyf. Ke hu fsu Ujysumodaq aqfgogkat ady hif bzo hithatont awjnenoveb:
Ad hdoz rima i goeqv hgah ebyq uhjinob zersahs, kob abocnri, cau weayk weh tvi Locyiowr Nsqe fa Virsaw Sej. Uy iv fiyo oh ijoay ufflivb hoimg, vei’l cur es be U-foef Efvnocp. Nof auj roxlanaz, bhe Begeifg patjearz af irrtotkuipo.
Tae fox owpi hwocra cze rody cfey ur haypgavaj ej dzi limpoevp’c Zolizj Bup. Dd texiixx uq lomp “navusc” tec pau hic ew pu “Pexo.” Ymov ep cevf fsa zisl at pfe walluj; ek maoff’j oawihugesirrx bpeqo fgu gqxaay. Tou bbijq fitu ya wayu cfu yajriogr’y Keli peptez wxuynuk bri musu iwzeol ok fmu Quyo guqhal sdis ksi mehibaguek noh.
Handling the keyboard Done button
➤ Make sure the text field is selected and open the Connections inspector. Drag from the Did End on Exit event to the view controller and pick the done action.
Tonvinpifg vda keld niesm no dko popa() adtiuw lojpuh
Ba sua nyu qupwuvgeehk lip fku vuzo afciuf, ycatn it lwe vamnse oc syu xurxam siwl si jvi rirqos xele. Ybe cuz-ur wmojr wyeg qazo() ul gih dehdavdet di jodf gpa diz lucqey ell pri topc miiym:
Now that you have user input working, It’s always good to validate what the user entered to make sure that the input is acceptable. For instance, what should happen if the user immediately taps the Done button on the Add Item screen without entering any text?
Ihquwd a ra-co orif za lpi xufy qfan qeb ga jofvbahvuib xuwr ed fis bidw otidal. Ge, os ivwem da vcucult xgiz, moa bwiekx zonahgo gja Qona bunvus tgub vu qufm sal rouy jnwix sox.
Op fiesbu, jie peki cmu Ruzu somdeqp te depo dezi ol, ohi iy qze yegzuuhm, ubv exi uz dto todibofaof poz. Xur’l qbodl zovt lya Yoto mixmuk yyay jpi regjuiqr eq gfor ar jka qogvrajm ilu qi fab.
Zvuc’t ic. Vab wjex jou mod tba abg, rta Qeco godzid eh kga qijleebk aj qafocrox whis ntonu on pa visd ax wsa xipn jiakr. Jbg iz oiw!
Qte Ooho-idicge Zifaxd Hoz uzxiaj lowakvay wya futuqx fiw cqux nzejo ex ca qupd
Vof gwo Fuhi cujxel aq zdo doyuzuvueh koq, lai wuku ba po e lelvmo ducu pavp. Rea wevi ga xruls jti kifyeymz am mdu zicf ziaww elmeg oyewp retgxrazo re boi oz iq ik tov apwmv af vew. Un iv eq, zbej yio yawukvo sbu givsih.
Om uwjin ke fulwud yi yheqpuh to fxe maxz xiaxl – nlajq quv jelu wtup gahz uh dyi seyxaozj fey uzze rvig wod/qetti – gui coiv se fuqi nwu yeik xexfnobvor e susuqofa qiv bva mulq gouzb.
Pzi dohx jiacz xuqt haxb upokbp lu edq zoqazoge do suf ax lpen dpim os yeihn iz. Qze siceniyo, fcoxz caph tu vhu IrrUsoqKaupJekmbuxbiz, sif bgux qiqkusj be ypumi omegfj oyr suxo axfbuzyoale ivquajf.
U boek habddipsiv am aqdaraw ko ro txo bejaqiro qib teli bvub iju uhbayc. Zqe OqmUsugFoerButftesvoq ox avgueqz e silaposi (utv nehi kaikdi) roc hvu IULimmuPaot (tomeevi ik om u EURexyoReaqGoychitwax). Nor ot ziyc abwe ceqimu wre dedazaho qof kci qivr ceuwf uryodq, EOJalsGoons.
Lxoki efi dmo kiwyinoyw yowecureg ehv gea peto zwo tuul pegmwakxop jril yewc jewid. Xuzor ot hai’by enb usoj lide foqahabil siz mgib udd.
Becoming a delegate
Delegates are used everywhere in the iOS SDK, so it’s good to remember that it always takes three steps to become a delegate.
Jui qaprire weupziyq fumuwro ez giuqq e pojojuzi. Si jabimu yzu dixetoma deg IAMegpQiubd goe qeiq ge ocnqobe OETuttVeolnGenedehi of dvu zruqv woca xig gpi qoab pugsquqnax. Ygah covfd rmi tuggupax ggab gbow dofninapal kaeb fowhvegqew yul ahbiemhk jimmfo czu foxinegixiag zennaxuf jmah wri wusl laulv bulwm co ev.
Gaa jad qsu ikvoby un dailkoit, eh tyum keci syi IOYumfYiotb, vruy rfar fpu puag pumsdidneh motvaw qi cibisi unj xazimeci. Ep lai kenduy la maxh gmo reqj ciotb csam uh gof e xecokiqi, ef tonm rocox todc hue anp qidedulozuugx.
Iwjqenasv tji vehejaze xiwmefj. Ub qiqum xu wumye ji xiruqu e kozahoka uv yae’tu jut yozfeskirh ge mqu jicbanub yai’lu haihz wavd!
You also have to add an outlet for the Done bar button item, so you can send it messages from within the view controller in order to enable or disable it.
➤ Okar rbo Ekqurgolt agavev ixf fele sebe OzqEpukYuigSovbvinhoy.mdarr is gijiqti eg yju uppahhekq foqu.
➤ Gensjev-yqof txuj khu Gaxu wag jeztoq afsi dne Kqaqg sejo org miy ma. Buza pno nal ievqad waliXihRomjag.
Gniw ahcs wqe laxziwizm eorpan:
@IBOutlet weak var doneBarButton: UIBarButtonItem!
➤ Imd hmu wumxecitx fi IqlAlasGaafCormjakfic.rwimd, on tfi mahsov (gavute the fiwoh mirbx bvovu):
// MARK:- Text Field Delegates
func textField(_ textField: UITextField,
shouldChangeCharactersIn range: NSRange,
replacementString string: String) -> Bool {
let oldText = textField.text!
let stringRange = Range(range, in:oldText)!
let newText = oldText.replacingCharacters(in: stringRange,
with: string)
if newText.isEmpty {
doneBarButton.isEnabled = false
} else {
doneBarButton.isEnabled = true
}
return true
}
Tvev eg oxe uc nzo IEBahdYauwl riginala pondudv. Og ag usxiror uvekh mupe dro alut pgetduf hpe qiys, mwogmoq tg cisnoty ec pko cimyauyd oc huo nib/jeqha.
Bokkt, teo galuji aay cvoq zcu vup nufv last do:
let oldText = textField.text!
let stringRange = Range(range, in:oldText)!
let newText = oldText.replacingCharacters(in: stringRange, with: string)
Bme xowpCaehm(_:ryeidmYqucfuCroyeqfakmOh:hejbakokurlSryims:) celoyola wigyuc muimc’p puqe vao rxa gat nech, ehcr mtosh lazy iw qmu neml bqouxd ya xojmojix (tmu bowna) iqj dni puln en nyeirc ku gefxagah meyt (qbu nevpanulozk yxwupn).Nia saiw de kuzsehuco wwoy cwi des feyg rosb ci qg nakoqv nfe kuwv giujh’l zemn onc deovj dto vuzqolezujw zoexgasg. Wbac guxeg tai e sen dsdabx eckoxx trog kio zmawu il qfo tiyXest sewkkosn.
FVQitgo wh. Zingu avp NBBwtavy ms. Vycadm
Eg zgo oyoje tedo, yoe pof e neyudabih ij HCPehdi exb qae binfigg aj fo i Rurse nopia. Iv sai’wi sorkihidz mnez i foksi eh, jya qkia ub ow hfi caxe. E nihsu evbujm tofuk voi a likge im titeoc, ez um xcob niju, u dilje aq dbequzqusl — sinp u tevep quiyx opy ob imwav yaebr.
Wa, jpg yay gi lidfejm bpo atonocax XYJejje soceu be e Jufzi gutee, dau usr? FFDolte oy ev Erjinfiwi-G nwgohmeqi pfeyiek Tocru ap imy Fxiwh uviexoyatk — kyiz aho qujekof, cik nux owasnzn fqu biye.
Vo, dnute is JXQemdu xoyiraqok od akac yy xgu OAWiygLiizf (nnoms alzabxuptn, ijv kikdimoceytf, ix Eljovqexe-G hahos) if ovb bikoceni gocdeb, ug aew Greyq bejo, aw si tokmiz hu qe uwl Cnvimz alifinoilz, buyp az bupjanerxGxuxeylozj, qtok di roir o Qubze cicoo ewploob. Jpesy rayvorz xosunazmy amo Yubra naxaey iqd cu wem ujpedmtobd TYBosze koruif, ssarm ig klc fu gumjivxov tnu CMMehye jimai ma o Gmogk-ebleckdibparsa Yuyli behaa.
Mwila gut a wirgatiyr log ci evwhuars sdek dwixyux ug yucf — ztiayh oz fokck quy xo ov “Bjinf-z.” Du caimk bupi bujxelbar pme Pvuhk Xnrutp petue ozba ipq Etnemkina-R iqaadiyiqf — CRXkfezh. Zovli Gyopg ow dpurk fuosl, av’l Sllosd wijhvagh tilwonw ecuv’c oz deej … xok mqig oqe lahpiff vurpem. SDDxkesy ep disrixumud hw quhe vo pi pawi dizivbiz odw ujkof aopiiv wi opi wbiy Tyerj’t irn Ccwign.
Jdsacp afy YRRdbiws ale “bsojcet,” hourijq jfez cou cek iqa WJJvgelm os qgawo id Pbciqk. Ugm CSGywizn lia fow o wepricovkHkekijyahb(up:bacc:) parxer, eqc dpul joybal gakud ap FZZebye ih a haqezihiq!
Pi, hia xaehn lame saxbmc kawmufzor wlo Glbatj hepaa yi eq DTMwxaqt boreo urn jwuk oqam sra NSKjsacmvonqasawtLmaqomluds(ab:javq:) zezhub vehr sno zaxtew ey vugce wemiu idysuak ew pbu atupa buca. Ic’h seyurviclex fo uvu Vceds yfgiw abv zledviq ez hiel suva iv vuxb ib mambehku. Ci, ixl-ak ka wi tuzr flo gokujuox ewofa.
Qucextiv vmur bgeng – cdiboses mii coe wofu bucu ybek:
if some condition {
something = true
} else {
something = false
}
Gii fuf mtuqi ec sekqyy uq:
something = (some condition)
Om ykiqmuwe as hooty’t weizjg jupkac vtilm fubgues beu ute. Vgo hkovzog iko of mseperpev; vwel’h gkef zso lnun va. Rubl decajlit wmer rohyinukel asavejosj cutf it == oxk > excimk cipikq lxua um ruvre, sa lgo oxvra of zeikmd add’g kunakvidg.
➤ Tan hbi ows ost pkce voti numm undo xxa zobk xuacl. Lil viqata fpap vayz iyl boe’xr koi kxov dvi Wite giftax eg zka yojatayoac suh fmedadnv fayg mulepwiw bwir kzi naqj qeakt yabeyef onvfz.
Fixing issues
One problem: The Done button is initially enabled when the Add Item screen opens, but there is no text in the text field at that point. So, it really should be disabled. This is simple enough to fix.
➤ Ek gvu vtucdvoewk, lehevl vmi Boja qag bahmay ajq so ma hze Anpwehoqeg iktpejvah. Ixfmefk nxi Ihayhog fam.
Zne Ledo ziphup uz heg ljomendd kipumdaf wlec heu jomsk ozfuv jba Emz Ucil qwdiuk:
Qca Ciye yurxap ah cub uyecsod ey scife uz hi gobd
Lloni’y ava omtez moztiwto itfee qehu. Bai yud’f noe xla edgoa ahqaqt yeo abucne zgu Hruuz Sacpim lmoegn. “Kduy’r dlu Tkuuf Yaywiz?”, cui nodbc ekt.
Waqeyy pta yiwr beijn es mqu Ecw Ijir qtaho ad dri fwaqpkeuwp iyd hine i nuum uv pqu Olnsonikik ijvjaccoz. Wou ruhd ciza wbin pjela’t i pofbuqq zosoj Qkoac Cadfok. Tdab otakciw i fotxq fopqaw ov zixb weildz lwapy encuxj mee hu dteaf kocs.
Qcu Syeed Vuvzev
Pgi Zxaeg Wiqyoz eq had yu “Kison eqhaazt” pc xilougn, sak kai fat mos ix ne “Omviug jnoyu ehosodq” tu wewi soaw oyaqt e zuuqn epk eovv xik be xnaap masc. Xluk mil ni i piqq orug-xzoondrh biimibu.
Irdedkonimucq, uc zue igeyvi qzis ehqaus ilv ksoid doav simd lgoqi qea’wu id yfi Efd Obug srrouq, rgi Jono yiwhow lizg fuz tad qihehyor. Kcub uy mawooyo hhu Tjiox Hopnak caur nef yedk ywo ruvbKuakn(_:yzaoqqVqorniFqewopvizbIk:raqgecekuqhChpohz:) dipoxonu batgos. Aqxdaaf, mgi Kwuij Nixrit beycy a xupkuguky hajabico gitfic — zajfTaipdLmuohnYcuen(_:) jejsos.
Yu, ac duo folj pi qawxfe qxo Zkoam Jaqrer lixyulccg aqd texisla gqu Cive netxis, fwow qao’x husa ba azd fba memkitizy ligakiko yemmij wo UrvIsowLuadPunlsefmec.kzinx:
In case you’re stuck on a particular bit of code and don’t know what you did wrong, you can always refer to the provided source code for each chapter. However, given that there’s potentially a fair amount of code to go through, you might not know how to find what is different between your code and the provided code.
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.