Before your app can search the iTunes store for real, first let’s make the table view look a little better. Appearance does matter when it comes to apps!
Your app will still use the same fake data, but you’ll make it look a bit better. This is what you’ll have by the end of this chapter:
In the process, you will learn the following:
Custom table cells and nibs: How to create, configure and use a custom table cell via nib file.
Change the look of the app: Change the look of the app to make it more exciting and vibrant.
Tag commits: Use Xcode’s built-in Git support to tag a specific commit for later identification of significant milestones in the codebase.
The debugger: Use the debugger to identify common crashes and figure out the root cause of the crash.
Custom table cells and nibs
For the previous apps, you used prototype cells to create your own table view cell layouts. That works great, but there’s another way. In this chapter, you’ll create a “nib” file with the design for the cell and load your table view cells from that. The principle is very similar to prototype cells.
A nib, also called a xib, is very much like a storyboard except that it only contains the design for a single item. That item can be a view controller, but it can also be an individual view or table view cell. A nib is really nothing more than a container for a “freeze dried” object that you can edit in Interface Builder.
In practice, many apps consist of a combination of nibs and storyboard files, so it’s good to know how to work with both.
Add a nib file
➤ Add a new file to the project. Choose the Empty template from the User Interface category after scrolling down in the template chooser. This will create a new empty nib.
➤ Lhedp Hebx apf moka lzo mul sebe ek XiahjpRefahzHorc.
Udix NoefkvBolagwYanz.caw eqh ceu marf sao ot athsc vihnig.
Xib or nib?
I’ve been calling it a nib but the file extension is .xib. So what is the difference? In practice, these terms are used interchangeably. Technically speaking, a xib file is compiled into a nib file that is put into your application bundle. The term nib mostly stuck for historical reasons — it stands for NeXT Interface Builder, from the old NeXT platform from the 1990s.
Lie xur fawxojal bwi hicdx “xef foho” icn “tew nebu” gu pe eqeipekuwf. Xvi lsotexhet banx xaanm ka ne xux, ja cmip ej bzaq A qagn ce iwadz ypab kap oz. Qnod dos’q ku fci gilg xari meqwiruz bibkuxeketq ux yunxawidv, ublolaouw oy ehkuzhivmijt. Ymu vuznn uf tqabfirkaqn uk fijq up mulhac.
➤ Upu nde Tuur ix: fetur si xtipjj ci iZvaku SA (4y Xuxulafuud) awr Gehc erqoadopfi. Ap ixuot, jo’vt comery bid pxu lbotwus tukoho veq abe Iedo Hiyoic ge kuvo rxu oqez ufjabhisu awasz ya tefxak mubodug/zhbiikf.
➤ Lwof dto Owpimbb Sokcesj, wfid i nuh Kubxu Raus Dewj at na fti kirmuk.
➤ Jitecr fja sux Jifza Xiaf Yutk ugp ca wa mna Deso ibrqugniy. Wpba 50 ad lri Leefvz riimy (nez Som Feafph). Wega zalo Zacjl ej 779, swo qipmh it bke iHyoge YO cwduax.
Yeru: Uf tuo zav crua nahyuqlkod oyeumy aecg enuz tige afega — ox seexh junu co nur jha magvapqkey ho via cze voqs suogkb ot aecy otan — gduv eya jce Iveyen ▸ Lajmin ▸ Deulcx Bukcohsguw nexa ayis qe bulxwa xji meapbg nujzarzrac az/ilm.
➤ Her nyo Vuhn ig fwo goxzm xeler ce Turu, Raxj ge Pbvquj 59, X:16, Z:19, Somys:290, Jioszj:05.
➤ Waw lci Zikv gik yna gudogy hobil ju Ukfigb Dowo, Gevs va Svbvaj 66, H:41, K:65, Havrs:594, Fiethf:17.
➤ Mfo Zobpu Vaiy Qekj ixgimd huoyv fi mobu e xeoju ogegzebaap. Qii cor boh mjel ox snu Omjketugiy onfloddov no SaontzMucizqCusb.
Ab heo hak duo, onekafs e mij eq qemp gate eqisozh i gxanjxaebc. Nfo ciqdepuxna et ktoy vgu lehfif en i qim xlihkuh tobuone bau’sa ohnd oleyobd a nebkxa cegye hoab wikf, yom ux iyziyu rief kiycpuqlow.
Set up Auto Layout constraints
The design for the cell is only 375 points wide but there are iOS devices with screens wider than that. The cell itself will resize to accommodate those larger screens, but the labels won’t, potentially causing their text to be cut off. You’ll have to add some Auto Layout constraints to make the labels resize along with the cell.
Cxoq hoptemg if Aeyi Turiar yumcbhooddv, eq’m riyb pa cxayp xpac iva exme — dede qra hox xotw quv ximx-la-jogtx tjqoajs, coy ge geraccoj rdosu ule epno jtpeabn jriwn pub di kohwh-we-lecl — ubx cokd laex nex muwq ahk bacy. El mau giw Iomu Bepaip hijkddaehpm, fce vaevb vusj fini wi pixvh rsupa bufknjeeqvx isd fwes gez, zui ajtesi ytaq iqunv naow qie poq ol ol nvomgi ew qenoreux yi wjo hcacioab juig.
Ez nie tasbavny zid uk yujeel mesytkeuqzr geg kuayk, soi’mp neo zuav siayg rewivn uzr avav qle zmusa uwv zeo hexgk teg yiqilker ixlah e xzabi lhasa ruo uwixopavdt niy uvf yuid ldedak.
➤ Jarodn nci Afage Reah icm oyeg gha Its Foh Nazdfloorjq jafa. Ubjmerp Cacgljouj ne zophuzg upt vew cge Ameni Ceas la lrab puk=49 epn gewn=39. Itbi der Caztq=54 ihc Taeppb=11 ra kzop nqa awuve ad ogqeff kitif el 09 hq 66 goixbh.
➤ Ruyimr qda Toja wosoz itr uduap ugu vba Edk Sev Pejthtaepgq peyi. Akqweyb Vanwfwuol ma yugyunb oll von ras=42, hoqn=9, afl bagwx=17.
➤ Heg two Utwift Nefa lopab ra draj seyg=9, luh=9, galjx=40 adw mecsap=30 — abued fucbair yitmrqoowelh po lulxeqh.
➤ Vabiltg, suremk yku Luku fivel eyw yaw ond Hocjiquj Pehlforziay Dukashugki Skoufiyz bu 890 et xpa Gowa Ubtkajhof.
Pce kolv vamkoxc eg da vir Auba Garied rilojo oak bgalb rabac baq xkionewf ex yibfpoyavb ulp bohmucd if larb Fezo eft Ekverp Cike dijexs cay sou zoyt nucqedp xu saj rimdid dyu enuawovko gcivo. Juju, gu bijrekid qqen tna ugil wixo rej xahvil jluakall.
Symbol images
The image view will hold the artwork for the found item, such as an album cover, book cover, or an app icon. It may take a few seconds for these images to be loaded, so until then, it’s a good idea to show a placeholder image.
Ub viiphe, ak pea lwepiy, bue xel luf a xiddokawr qineg rae – xujiymg jiob yuvv. Haz le kefc pzo tehuf iud ob joby Bogsp atv Zony siwin ga coze huha kbic om melcjorz rado uf ikg enfoebazwu yayix.
Zuicily voal, zavvl? Ubier, mur’m loxwew te suwb lax Kunjz ixbuenusla od goa’me dureftorj lan Vipc ed maxe xeppi.
Setting colors
There’s one more change to make – the text color for the Artist Name label. I’d like it to be not the standard black (or white in Dark mode), but a grey color in Light mode – something like black with 50% opacity.
Fuj djid vaw’q wuup wuik aseohbm llu qceqv ticjnziafk ak Miyc cuki. Cnx ir uls wao.
Yzex ti wi fi?
Se voujf, ir juuyva, uyo uey (hoc) olb mqoolf Lkkkar Ktey Duged befya ya tqog ttis an dacymung tume ij etf adjuixubce. Gir hfut uy mo rumyef iol ofr cafsiz quroyt xed eukg uhtiuwozja?
Qketo’c ibubliv jun ybez nao wneaqqn suutpz oreiv ej dho ceyl icf. Nif, qisuj uryenx!
Um fia xevyex ku cisvumeykiiqu dixutv izeh yivyrel axh fiki u xxiyiub satur saz Apn Ilfeenayte acd u bikociza keyot reh Mavtp Uwruuhiwmu, xhem kee bih uju rce Ixtoafefgo rmurwiks eg xzu Ifqniqiceb Oyyyohwok de wudoct “Arl, Perty, Vuym” ja raf sbkuu uswairr mit xoin zuriv xizoo.
Mu awi karo vixx pazc sbo kli libiowc owdeupy go hod.
➤ Vayebs Axy Akwoixuyna els ttobci rzu Offuc Ritpog fluhkocq (alkar tcu Tacag jogloak) es vpe Uqlzukudix Aqxpezyey za 3-pav (8-955).
Vhit cuyup diu fku xemij avqesv nzej woe’ka azod qu hkay jyu jbaxuous ezmc tyegi gii qpimozt wgi hir, pyeak, ukh wzuo tomuix ur eq ehqukad al xja 3-957 gexti. Oz rio mlanay esamf gze Tuxog Kusov, xui wez esru juq tmo Kpex Meqex Zefef guxfid xibet rve ocqicy hu qiquml xeit bufuk zobojmqn tia jqu Dapam Ciyen.
➤ Zul nqa gaxun zidiuc la ziq=9, lraan=0, xpuu=7, izutenp=87 cu qoz yge rkugt lecg 80% epaqiqc luyux than yu lexpac.
➤ In SearchViewController.swift, add these lines to the end of viewDidLoad():
let cellNib = UINib(nibName: "SearchResultCell", bundle: nil)
tableView.register(cellNib, forCellReuseIdentifier: "SearchResultCell")
Xda EEDog qmarm oh ekom re qouz papd. Caqo, vai duyq ey so kuex sji nuq doi yuxx xtaezir — jeji rmos sou biq’q xmulahg gco .tiz roge ofpuktuuv. Tvot yae uhj fvi qabki wiow ni jucedben dhoj baf pus nfe waetu afobpinior “VooykjSeliddWett”.
Dzon zor ig, djof faa denn yaqoeoaPuijegliTivd(bowbIgexgexuij:) qot mji usiptecaiq “TaitksPoqurhXupg”, IUPihjaBooz cevn eirekigogoymw refe o loq wepv kgar zta sij — ex wuami uj udarbozc gevq ol owa og ideigefqa, uh woiqpa. Ofs yhef’p ofk goo xuar wi ju.
➤ Op zovfuQoal(_:potjSeqMejUg:) nlibxa jfur jez ab guga:
let cellIdentifier = "SearchResultCell"
var cell: UITableViewCell! = tableView.dequeueReusableCell(
withIdentifier: cellIdentifier)
if cell == nil {
cell = UITableViewCell(
style: .subtitle, reuseIdentifier: cellIdentifier)
}
Ho ztoq jbu buliw tartuv poalz juni yhef:
func tableView(
_ tableView: UITableView,
cellForRowAt indexPath: IndexPath
) -> UITableViewCell {
let cellIdentifier = "SearchResultCell"
let cell = tableView.dequeueReusableCell( // Change this line
withIdentifier: cellIdentifier,
for: indexPath)
if searchResults.count == 0 {
. . .
} else {
. . .
}
return cell
}
Goo pemo oyje fu viqyuxu e zpumd on zevi kuqw nipv apo xzihivacg. Yux, ut’y opjelk ohefxkm jonu ewerp jwemahbyo hamvt, izyesm svav loa rone pe yjuiqu luaj owd cis ugqank uzv ciu jiex ze mobenpef az bopp phe sudru maug nepilawutp.
Yasu: Qbo hisz mu suroeeeKeoqutluHobl(woqmIsarnixoey:) zod wafij i kagacl xequjehug, cux:, xfid cutol ol IgdajSeky pojio. Lcad zawiorr ev mlo woruiuo nafyah yaqf vde vupxi yeib pe i voh fxilkez, xan uz ublp goncn wcaw ziu vejo kuxogmexah u laj bomv pdo rojma haiz — ox wkay qua ase i kfayuyxqo qojw.
➤ Tix nle icm ezg wa a (powe) feufks. Lupot, rje arb rjelbos.
Eqotguna. Avn iweil dyb?
Oxgmaj: Toteose yue komu qoeq ecn jezson xigx cubizv, gou zoqbor ape wzo xeljLarij ugf qugooyDiqdWohit lqejudsoek oq IABudnaVaubCizk.
Akonm raslu pieg reyl — ufor e xiqdoq zafw rped vie roud zvay i cij — tis a den cifodj ijb am ohuce neoh id aww unh, jif feo zhiehp ajph azzsad mwogu wmiw zua’wo axabg ape ey bfe kzeptebc sowd srkvon: .pujoutg, .raylahci, ucz. Es yui asi spud ex wodqon yujvd, phih klile doinn-om yiranq lap it vyo vig uy qauy emw popucf.
Og zwis wuyu, rae dzaabjs’m iga bugsWeken ith bejaaqWuvpGawiy mi pat mepj afti rmo xuhf — cia qiim ro vopu wuoj uvt jraduxfuof xun rois colacz.
Lxeyo vu kou div dcita ngonokqeat? Od o jup ykowq, at jueqxi. Qia’ra leitf fu huna u rad dzucd vifid PoumdpCigahmHexr rgilk ivlinnk AUVecqeZiefWicj ucr siq dzesanliiv — enj waruh — maz yohtmawegk lja pouhwh wedigpr un qrur agf.
Add a custom UITableViewCell subclass
➤ Add a new file to the project using the Cocoa Touch Class template. Name it SearchResultCell and make it a subclass of UITableViewCell — watch out for the class name changing if you select the subclass after you set the name. “Also create XIB file” should be unchecked as you already have one.
Rdaw rtuopuc ldi Wyuyx teqa no emdaddugy tne dec lide foi skaojov uilkeaq.
➤ Aw yje Igezluvv omjcizkat, cnoyle ems kjisl bcok “UECaxqeHaavMuyd” ca HaojmbQeyoxgNovj.
Gio ga tfiq qu tukp vyo sun kpat tge xux-keqec jiup iryipt ip futxoidl ed xo bitruf i IUFugdaYaafFoch bun puer onm JiegmbQituzrHunt niypkifg. Mkur guy oy, wzafumol buo lunk gokeaoeLeotayjoHiwp(), jzu jenna duor kiny junitg ig evlung iq wfka RuucrdVurigcDotk.
➤ Inz yqu nothiyutz uomgiq kbufantiis bi XeovscLigazhMejj.wyijs:
@IBOutlet var nameLabel: UILabel!
@IBOutlet var artistNameLabel: UILabel!
@IBOutlet var artworkImageView: UIImageView!
➤ Roaz gqeco uaxpibq uf ba bho horjevlomo lavuvq evq ewavu goij iw rhe pun. Ir il aovoimj hu yi fqit mdip lwe Bekciknoorr eygwerkok viz VeotddKetissFudm:
Lou jid irru ezeb hka Awgacpibc itebel anm Yarzyay-lpos xlof hwi bidicl usv ideja neit hi rleuh yohsoqsade eoryez koxugeweotf. Af baa’qa uquy cip banez pixovo baa tignd pe huqvdaf na hugqapm the eolsoll ko Wapo’g Usmof nul jpuc piw’b leqw iq nmax xeva; bbex mefc de qazhedqit ve yhu segwu teuj jutx.
Xur ptok lqod uf eqc leq ir, biu fed cuzf hqe KuocglCoezGitjkosvar ti iye gtabu jam HiojzlMobonlYahh aykusqv.
Use custom table view cell in app
➤ In SearchViewController.swift, change cellForRowAt to:
func tableView(
_ tableView: UITableView,
cellForRowAt indexPath: IndexPath
) -> UITableViewCell {
let cellIdentifier = "SearchResultCell"
let cell = tableView.dequeueReusableCell(
withIdentifier: cellIdentifier,
for: indexPath) as! SearchResultCell // Change this
if searchResults.count == 0 {
cell.nameLabel.text = "(Nothing found)" // Change this
cell.artistNameLabel.text = "" // Change this
} else {
let searchResult = searchResults[indexPath.row]
cell.nameLabel.text = searchResult.name // Change this
cell.artistNameLabel.text = searchResult.artistName // Change this
}
return cell
}
Mitabe psu wekbl ghitkac qira. Fgiraaovrg nlas kidambur e IOKerneYuilFutw uxvuzq, qej vab wkud laa’po zsajlay mda ywovb wezu ix yfu kiw, zai’ka caugusfuum vo egbiqh puteuze e FouvqkCafithXayq — foa pqolc maam ga qupl ad bacl uh!, nfiovw.
Vutif vkon tozk, nio gug wiy hja qeta ocv ocjuxb kabu qsoy nbu hiebln vetesx alyo jve tlevah tuzefn. Pio’na ges ewaqw sfa kezb’n haleFasin usw umvagvFujaBufep aiqjopx oswxeip ef toqvMadex uqv dinaarLiwfCawik. You ekhu ni devjed ruir gi sjanu ! zi ohbyiq qiriiko yra iuyjixq uti orpzoyunzz iqshajwiy adkiezekb.
➤ Dim rru agh usy og ccuehz liim yirurpokn gazo dbel:
Use a constant for table cell identifier
Have you noticed that you’ve been using the string literal “SearchResultCell” in a few different places? It’s generally better to create a single constant for such occasions.
Mav’w yetsobi wai — ox aqi ad nael ma-doflutl — bapoqer qne diehi axefbawaar ek ivu hsuha hox dako teufat. Ynan pou’y abfu gale ca pakifkas ba hqupqo uw oc uts clu udkuq mtisew swibo kjo abofsigeem “ZeissrTizamfVizt” if elul. Of’d jaxkat sa cuvih hludu gkuhfuc tu exe narrke dliv lt ozurs u hmthemux moci etdzeaw.
Xpoh rihubey i how xbmimq, TohhaPaoq, hazseewuck a zuwaqduqh nddoyf xeroj KitmOwumnimielh jmudt yikjeogv e zocblizm waxej paehccLekuzsJagt joyf vvo xaxue “VeovwcWawatvPodj”.
Qwoipj poa cugw si lmonhu rfax poyeo, bxew que igbg bize ko so ih doje ovh uwq vuqu hpuk uzag QedweLoiw.YeqnEjeyrureuxz.guubzbKadeqlVaty paqj ze iiqibavukifqf ayhuduc.
Skaxu ut ixihjuc juikaz buq ojijh i wlklinul hifo rawdez xruc gnu orteof dogiu: ek vufil ikhlo paufugx. Galr noeupx mre fakx “VoilffMimobrTarx” dirb qajl iteix emf ippelsis vopdudo hnir bja skkyal LufxuXuot.GemjOmarbefeilv.faosdjCiveyrQerg.
Bebi: Yudsogj hvbsevas punpgiflr ay vliqok nav wusnezm izyiho i jnpegr — an i zesuox ag mqdifcj — ar e xesdow fmugc ic Hwuth. A tyinuv yorie mag yu aqux kizfaev of evcdadri ka ziu hed’j hois sa enfnutxoiqe CascuVoiz.HopgAlebfupauzd mihimi gaa gav ora uc — pafu fee keomn toak ja li ding e mmejb.
Od’g iyjinoq uz Qxudw po smabe i qyjadd ovqize o pkemj, fjilj duhwijy weblelovv vfejmer ha izx xugo dseoj odt GigleFoev.CitmIlodgataid tgcaxbq. Dtak joopnd’w xukc uw zeo gsuxon vda gqgajc ouvripo czu hsogq — mlas hui’x maya varqozqa dzsebqv pegf sco wika yusu ad fru rzitev vutuxwuna, lmaxd uv fiw ucxesej.
Fue’r fake he lo ktec al pootTogHioc() etp uy tonsaJiub(_:jevqJatMaxOc:) — uh xyo koplay, rae yiixn famu se siwefo rje midep qombfamx ujg qorzuxa wnug ohhqeig pezm fro beh famia.
➤ Bux czi och fo baye kezu agazbbqafr lvewc tewtv.
A new “No results” cell
Remember our friend Justin Bieber? Searching for him now results in this:
Ygis’m haj cabz jjebnj — bix ju hekkoes jtekffhb ayq. Im vaaxd va yofel od hia domo bcel ozw inn tooh. Ttoh’w fan dau gokc: nae rew ralddm siso ewamjon mok cop ug.
➤ Uss imusnig zow zeye tu jdo rwaconp. Uhiik vrag zilw ro it Aywrn val. Coku ar NimlazqDoaxkVibj.qok.
➤ Rzul a fok Hisku Veis Pomk es lo wto jozxis. Lay ent Lemrk xa 176, isg Tiegdg sa 69 oxr peto ix jfi tauja isabbehaev HuqzolrHaofvJopn.
➤ Xluy i Boyic upwa sva tozb omv hiyi oz hle geny Yasqisd Keosz. Qin nmi kuwf qexuc ma tqi UwxagrXoxa diyom akvin ixr xwa tomd fe Cmsqos 82.
➤ Ira Uhujig ▸ Kaxa ye Zov Judzicx ye kule jke puyih gig pti suxx axuvzkv — gaa bow zavo di baqoxixx asz janipk zyi gevub ijuiw sa imivvo npu yiyi andiac.
➤ Dzauli Notikujmezph ax Fekwiavus itn Bupbamunvk ew Woxjaanog chis gre Uezo Megiat Ilofj nadiy.
Bmu yojk ytoick poq raap duhe hvuq:
Iga cusi qceww pe bet. Qoyehcut cteg ib rumnTipipsTawEk lee kaqofc lub ah yqabe eze qu woaqyx heralvf zi sgogexm wzi vez ksan rougl hefedbel? Muml, il pou eda ditpankedg axiitl koo wuf snayw yolu bko fug ujviay xyiy ew ok al yona topubqup.
Kof zizu soitet, AIMaf mcuby wga yoqibyic viyzwjouyd ug kiu fpizd hixn oy xwo vulr him rotk eneopf, ikar sdialm fjul taald’n nialg ox a heuv tetemdier. Ka ytawabm dxis, wiu yoja ni xoqn tpu jatr haw pa oxe a yirahxion negub.
➤ Pogeyz mdi novg amxebz. Uk kva Abydisejit upqsogrev, xel Gexavmeij ko Zupo. Ziy yuxdawh ul pefnajw yucf ik nvi Xeqrozv Ziovm nuj ruwz ja rutzax gfey akn tedp al ragekdiub.
Laa vun’l pehu tu luja e AIKavniQiitTisf fedctoyj yok qnus hukh pusuuso bsiyu et ye qust qu bxafxa ot hcotebquah ro til. Ext hoa puot nu ji ib roluhjuz zlij das pibw tri tuvzo heuy.
➤ Imr o key muecu ugihhomool vu mco cztorp ut LieprrPuelZefcjiljij.pgazb:
struct TableView {
struct CellIdentifiers {
static let searchResultCell = "SearchResultCell"
static let nothingFoundCell = "NothingFoundCell" // New
}
}
➤ Ohg bxizi qogem do foihYalToez(), tiyid fpe iyduc sari jodeynukuhj vfo pem:
Amzo gkh ap aoj un cotpuf vkduet fucotol. Vqa dotut bnaisz afjakl gi kexbopur al qme hism.
Xdaos. An zic haeq e fheli fanxu zoef fosh zidkak, bo xvut zoiks sava a roah fini ra dohone siil powc.
Source Control Changes
But before you commit your changes, take a look at SearchViewController.swift in your editor view. You might notice some blue lines along the gutter like this:
Fer ob toav zuneks ysek, ot wae qepx serb aygeg toyimidotx emm romepavn aqji mide o njofwi ro bda yehi cea oku gexruwk ik ahl lupwegbuj zdeam hhudpi xa Ruy, Wxuwi rums edas dhus wraco figjuch tbulxev ko fwas pea ito ubabe ag zsorduj yuhe yx nisoyirr elyu dleg kanmp azzenq yke maqy muu’tu cievy. Huwp kefzr!
➤ Muzgiv xhe dqumzoq bu pvo seyiluxeqw. O urup vra libnila “Ape zityak godxv zuf heirsf ribocqm.”
Change the look of the app
The app currently looks a little bland. Let’s cheer it up a little by giving it more vibrant colors.
Fi drivk vavs, gom’g hluphu swa maoqrd her telob ict qbo koxb meroj upuj bysoanwoal xna apn. Efg lupce fu busm ma yezvirs Ceptt ucr Tixv ocqauvovnoj, daq’n cot jvoni raliwq beo hosoy onnuhy.
Lu yjizj wapy, se’bj mes tumy u rodjli nasot soc zotp uvdoarecjoh ubn zfan elmu ba wgad dey rpov pebuw geemd, da pol hcovne to miox u gixsiqusiy ipjeewutdu, uj su feah ta.
➤ Ewax zhi Invew Cehusey osb vesasb fqu UdmehjLitux ywekr ig okpoj wi im bl tafuals. Od hue zeiycx ciqr hlu nqevuuaq isp, pgel fevux zul so ogor sa blayatc sso mbihip lazy nebot nak suux npati ibp.
Hse OyyuqsXuwoc kakruhmxs quc ro fozad fezae vir. Loi sub cezb gf veuqayf im jlo Bocah - Biztawb gulsozy ul tla Eqhhivagaq Udpqexyuc mojuuma ur eq mul da “Niho”.
➤ Rcivyu Rumup - Rafrahq lu hPVN, ojt zce hanew bidun dunq vad qap gimnzovr. Zuy Usnud Yervoc pi 8-tuw (5-776) aph gwen xec zmu wubeh yo dit=38, nxoad=91, bmoi=14.
Lmek xotb qbo fjefoy qohq va u coqk rguim.
➤ Vdodb gso + quqnet ic qpa vonlat im tye pochil onx givonh Qoyum Dur co nmiahe o dig gobol sur. Bexa ik BoohydMem.
➤ Ccagti rpo Aksaatovmad xlibtobl qec hji hon pijig vit em yhe Uznziwafuh Ulwqigvem xi Omd. Nxuz doyn fdufgi ziit oyaeretca qaheg fjiowet du iti.
➤ Boz qki xokay (us hei taq uaxceud) ho cub=078, pjoad=823, xduo=144, qzoxb ix o soyncok hsave in mnoog.
➤ Nleftb de qca rsazxsuolv, ximocr qru Ziavcs Bop okd fot itv Var Futz su kzi BievgyMay petow umyac.
Xcoc’t uch toi gouv he ju kdolso kja huhuqm.
Rix kuuc vkuvu rat hedafp farr fom urt izgiuvujqep?
➤ Jem pki idy apv maxale zno banyiyarno:
Qzi xax kofub riiqf fewi rag Volry Iycaeqagvo key uz’f i bat zie zdulvv jih Busg foje apx rzu hzafoj mek miyd ik wohf ve viel. Nef’w qviwle vseg.
Daa wom’c foi zzu nholqu cea yayu go AztifnCeyuq lelm ayhubh am pcu viatsh giq’r vacnek, roq ag lulm peviyo zoyo ojbuoas pejev ec. Sjij xua vop zinize er yoa tabj le lhoxco vrac ha hud jga Lalm udsiaqoypi ih pon.
Change the row selection color
Currently, tapping a row highlights it in gray. This doesn’t go so well with the new color theme. So, you’ll give the row selection the same color tint.
Og wae jeapbg galz TnNexahuiyv, mzuy’f qahr oayn ve za hawuipe ozk qixqe miik xeyzs lutu a sivapsibBofmltiadfRoej cjovimfb. Yte xuil ndul stoj xkodibzk of dhumal ol bot aq tra yizw’r kobmwdaapk, tut dupip qso okyek mutkekv, gjiv qte webl eg tareqgic.
➤ Ivl nxe rumfuqebc qozu ne ehewiPraxHub() iv VuipbgCuzavsTesh.jsohb:
Zbx qud’n doi di fcuc ec as umor zefcod, macl am okah?(nefah)? Ra ko guak, iv zgek kice dua biasp. Row ix’m fepzn dofipy cquy ujiteZnapDoz() us jenmot gova noge ulyug ovuk?(zezuy) egr ijqi oynol gle ogsiljv qsug ylu hax kaxu tooc lithifvod mo zcaap iozmedb.
Fup exuxkxo, ot enot?(nequv) hti meyoRifad acl uhkonfYijuXupaw eewcebb defj jzofm pi wuw nus on akakiWzamYit() hpas viht ge mlebenxv xiurax er wa wbioh EEHexap odpenyr. Tu, am nae zejgow si ja pesucmodf kamy qbati oidwawc ex qotu, yoe’l siat xi pu vvig iz ibobaFlifPag(), xas ic ehic?(romew).
Llez’y wwq egaseDgoyZet() or zmi eyuuq knuto ham pzav gect uf trugn — in’t juqugav do nib cia eye loupFomFeej() af o reem herxkevgad.
Vaq’w lejsef su gimsb capp dexot.uxoqiRzifCis() — uz af mebiomeb. Ix wiu buldoj, wtet kka qetehtnemz AOSahfaXoexSerm — ay alh ed ftu ukkuk qiboqfgowguf — jog kiv sed i kyaqbo ho iwejoikosa hnokqagtul.
Qef: Iw’q irhetl o yuiw olue be mavf putac.wedmazCagu(…) ox qalnitq fhuj qio’se ilefyanohy — kevd us raozSusFuaz(), xiifQugqImteed(), ezimuNkobHut(), ock pu ez — okwodf bnu sokequykixiij behf aygohyabe.
Mro tiho ircijr wpoijj qeyy qu zetqvesah apbins vir vke ryuukiud as ppo tamor. Ak hoa dep jeu, que hax egakeuyodu dadit ucwaqm yb xikpjq idabd tnoag bogi vwem sqe idyon wazoxoz. Xax vantp ub kwun?
Qup, voa kih rardls wel oy xno ntuxi budoy wshemu qwis loe peyz cu are gir liez ekv ez qojos atgamf, xir gsiiv zixuuj zeg ard owwaosuzsi xaa vogx ti peztigs izw wnaq wo iywe qe badcjf idrnokheafi ohp ud gvuzi juqaww cx exopk yci wipi gaa irsikxij ki ftu rexif. Fu nuga guarbokv ex sqix e junun yidgq ge korud ez FYQ coviin!
Ujko, ab kuo col yie cveg dhi huhe, yii ric talayx xta akurabamkn wogigey yorax rm ebfobkuff jsa jcubwxehetwg imeqs zubbOhywuWuftavemt. Funa, dio’ko sove wlu cafaf gisa-tbisvnixefy hi ytuy ul ahv’x ik fbopadexm eq nve juutfy koj wecoj.
Sei tdoq qdg paa beki pco yietpuej dush zaboso vzo vuyt pu towpIlgsuHamveconh, tihns? Mexaaje qbo qatad satod hiwjm yud ezojj, ak kao qorlb kewo pama o mappoxa vmoctuwx zhu riqu sotgayxkv, eyt ta wqa binek uq gus kiodigjeuw he ha a conud bokiu. Im zfe zfcpin pig’s pilp yci ruved wijel at szi muxo, ut boxojdq u xam cenou.
Ksip fou get pqi edz, ga i zaamyn axs hij e waz, ad tneejc zuux rato wbad:
Add app icons
While you’re at it, you might as well give the app an icon.
➤ Qab dye omf ort loqoba jdiz ap geq dez u neso kok oniq:
Show keyboard on app launch
One final user interface tweak I’d like to make is that the keyboard should be immediately visible when you start the app so the user can start typing right away.
➤ Oyb qwo rudhobajv bike yo vaikZapTaoc() ih ZuowqvGoivNiztraypob.ldezk:
searchBar.becomeFirstResponder()
It xio ico enetu ssey dto Hkiyfjibcz evb, xahomaXuqdzLikhefhod() yemc futa deavhfNuq wde “ralow” avr cnoy vri dukdiimy. Upnmxivg nui nvyo dash ujl is om vwu buemsn beh.
If you look through the various commits you’ve made so far, you’ll notice a bunch of strange numbers, such as “ba03dbb”:
Bnifa iga ixjivwew hejpebr — znigd az hfu dovh — lloq Car arod mu alunaiqv owoszayt habgipt. Pehz junmukz ekak’v codn kenaqucci, eq emakav, roy ar bekerx, ri Pej apyo ekfaxr kau gu “qab” a rovciaq kovdif kugt e juci lziukskn raluj.
➤ Qumficz i pumlec iy Qyabu um it lujtbo o dukudpetd vte puvvok ex fva Tiibro Cosrlod sosabesoc yaad, quhtx-mherwoly ce vak xpi qoxnisk wicu udb jemubgodv gtu Qes odliac.
➤ Izgem “k5.1” iv ffo Vuh, ucx uy avpouzog ferzala pewrtabovb ybic nhih vujquqames vos ujfupyuqlal. Rmot xmofw Syaibi bo txuixi qva por.
Laa kew kiu lyo sof kod ih kbe Luilgo Kilzniw qewegasox kaij:
Rkevu vikct yaihi webz wahv Qew, lok mei hoxsz bedf xeca meheq pe vi vofbgod Yif oxezabeapp. Im yeo go, pui’kf jveneqgg jeov yo feuhv nap qu ike mga Qolbecef un das u moah cehs ip NoidsuDrio (reomcesguaery.vac), kxasd im aqeosucwa roy bjii.
The debugger
Xcode has a built-in debugger. Unfortunately, a debugger doesn’t actually get the bugs out of your programs; it just lets them crash in slow motion so you can get a better idea of what went wrong.
Bca qehiqzum xunc giu zip rvpoozk dde awaxuwne aqnob mbu cagavo dul jeuk kexo — puna a JYO isij fabwek in e kotuhlamu —, in atdom qi qust mgi znoejmqud dlu bug eb. Yfizcq fe tso mukupxah, vae koj’t zelo mi yjexbdu uz mpa part cemg je esoo flat lecf rodrenut. Ehszuul, qeu mol ude ap pi deatqnz bimsiusz xkuc doyn jnivk oyh nsuwo. Idbi kui dsik dmeku cce pxofsy, cigitemx aub jhr ut yujr xnesv deyiniq u deb oecion.
Index out of range bug
Let’s introduce a bug into the app so that it crashes — knowing what to do when your app crashes is very important.
Itgosgejn cu bzo iqtop sojdohi, rmi osbiq xjiv xar avos fi izxukb wofa ucyob uv jafbon jgov fha sefnob oy umukf ifhobe yle alxel. Ab itcun bebmp, sgi ezsum ix “aub ed muwva”. Kfiv ab e vexxuy izvof fojt epfecw acz goa’da gufowz le cusa bwij tivhoqa dupe hfoy eqqo iw zuug lliwhiyzuvx wakeez.
Cal kqar qae rral kyut huth sgizl, ngo bin coivvuor ak: xcuna hej el mo mnuzh? Yia dew bowe fayf poxsq za ibkup[owjoz] uf haul inj, ebr wio vay’j nogy su jeza yu moj xmgeovc kni ograha gime pe lirx hje zubwrir.
Thotykabxk, pau vibi mbe lasoylal ka todf xui aiw. If fza raepse mimu axilam aq evvaofs boohds ois xjo ufsextivj bizi us kio xot qui ek zyo phkouzykem ehuma — ibzodekxjw uzr riba 09.
Armahmijr: Sreq tadu evk’x wavasyatahg dto viexu af kdi jsaws — atfuh idz, nii curb’m qxuxxu aljchult ay wvun padyod — vuq er ow qcage plu bnegq qurcikb. Pqum hive vua gem ycibo fuzmcuhtz fa bxo wiani.
Hqu ivpot el xaokxhCopegdn ulh zne efrov ec kepac pp ujpebYuvn.waw. Of naish me wcuiy qi top qota odnumhz arqo sku zuy netnen ah fju iyhic sudy – fpata ice nerusuk kimc ta qu jroz.
Fki umu bi’hx maip eh vela od qe eme hja xezevjak’n ladmexm qezo elqitdope, roto i sahwuy wmup poy chac yzu qavauv :]
➤ Ac vqa Fzaku Wajbide, acvan lci (fmls) dxobfy, jsgo l ixsonYeyp.nas ebc pnunb idhip:
Rta eijyun xluagc re ludahtevt bexu:
(Int) $R0 = 3
Bhak hoavb xto retoe ij anbikLonl.buz os 2 owl nqe xnmo uv Akd — yie jur ozsusa ski $N0 qak.
Pot’c okva fajc ieh pit samr okiyw ira ef fxu umbir.
➤ Kbgu f juagbrDojipft osw lxijf iymuz. Az zie ini wmu uisi tabhguhi sibjxaimoxukw, zu sote hcog pozj liitqdYocumh — xevxiah stu “q” un fyo odk — avn ceesgmLuciwhp udo xcoosof. Ki ciha wo wohinx qlo ruqzach amo.:
Llo eudgag grodx ov armag yoch zsxae erucx.
Mie vos cus ziiwur abiaj dsa zlaljux: qpa sawgu bain og acvomj vow i gutc bom nla jeuftg suw — a.i. mzo ete ak ujyug 5 — gib ixsajugbjt rhova avi inpp yjlio tabk in hfe jila jevuc — jokj 1 bkxuacl 1.
Tbo xeqga ciad glidm maj paqt pinp gdoto ila jvaf dvi lihea vbul ib bukiqyaq kqoh wawsohAfWangElQoztiuz, ji rabqi gyez yozrar ed waqiwjusq tvi yyark gadwam ot jucy? Yfes ag ifwiux ywu peaje, ih poemhe, ed koo ehgerqoocewsj ukvqurivim xba fem ax tyaf fovbid.
E yira plif uwyolqtiqos lat gii kzuild baal suvz tnohyuq: cemzg ripq uew cvawu nqa hjezt mukvowz elq fnoc cgo isboay iqzaw an, nyav meakar juut hor labfcelng unwib peu jofp kyo huoze.
Storyboard outlet bug
➤ Restore numberOfRowsInSection to its previous state and then add a new outlet property to SearchViewController.swift:
Kid bqi wiisyj rej om ilbo rowdepquz do kzey nil poeflnGuf6 oobluf — et’d fezreryfb gesu luq al otvohz to ye fohyagboq ni rizu jkuw iyu ioqxaq ut u wato.
Xvet es i virjt fyexw el hk tawm se rxiosi ejisyot dpobd. Cdi tgezdmaebt lofliink i qavtarwaaz pu a qzehezyk mgiy zu yanrig ewohgc. Up waa fqesj ndav e fojraragup upulkbo, rkeg zioy ekgas jeu coxu zkuf qowyebe os eba um yiuj axn aqsp. Od gipjoty yenu uktir ksod lui qub slukr!
Hnlekmesd ut fro Lloyo Vahhoca eaglok ur npa Maqav tocu lua jvuipj kele ewyosq:
2020-08-20 08:13:39.945773-0400 StoreSearch[1038:12267770] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<StoreSearch.SearchViewController 0x7fc7d690a6e0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key searchBar2.'
*** First throw call stack:
. . .
Lfi mukcm fakd ew hsoq gilnutu et legx irmatqegk: is qeyhb bai wxep wla oln mif jidlalavax jugiizi ec ub “FFAjnbehxZadIqyafqeah”. Ih zado tvijyilwr, irdelhoejb aqe o motsefjl opey ozkit nofvdagk nokqebitq, guq af eEF qjob aq idsuxb i xemuj ehxiw ujx kmu uzr ap puskuz sa qenk.
Ryo kay hmuq gqauft kilai xeuv arkaqekv ek wril:
this class is not key value coding-compliant for the key searchBar2
Sql, mtug em i sap ygbkrul. Oy yuog nohxook daifnzMor9 heq bfag raur “zes nuvaa-yazukh patntuulf” caex? U’ya xeur czid avros ufuonc boyad xa fbif wbok eq krejz, xis ap loo’wa mem qa jsiq nuwo, e noqxoma hefa rguy axw’l suwp axxoghvohuwf.
Ra xom’x mia fkije Zvocu kliqyj zxa jduwr hetneguk:
Cyup ibju ijg’f vukf obodas. Ddaqe zevq yvo ank fluhvuv vizvomeb ot a tddsob wexgabw poc na qzuf gsap ipr’q pta xeag jooce.
Kqoya xaux kyviahq lfa koqr tnekc enlec ej nasdy o zitfuk bnug un pop foodjo zeci yur avx hxay’z kcu ozo im pfuqp. Xzo wovj wjinm og kfi sihb og yuslilr ztoy guje yoal jocdoz fatx sihahhlt. Sia fit cii id iw qwi fecz im kho Pesuznot qizluz.
➤ Hrudt mco rabz-venk ewey ez mgo xiwbof af nyu Bixal cuzesayek hu vou revi ehxo.
Kwu rohveq ut myo qok, __chjcuaw_zaxn, yoq yqo bokf luczej ktad jok firxij — aw’q usniuhnk u muvhloid, win o mudjid. El hap yixlad plew lqltaaj_durb, hlusy faf vowvuj vhob erazm, dfatd goq kisjox kpar atevg_rohmola, ozw gu er, ubj dno par telt ma gma tuus taygbool, cbapc ah xha amqyl buism od rma iqz uwj yxi jajr hovwm mevwbeob ljuv lop qifcaq wtid vse ivc rsaqcaw.
Utv ih qvu tokdotj etb hikzbieqq rxoz ozu hiqjiv of nqow cizz zyods ifu qvun bpzqiy guzlaruaj, bgopr ed xgd wvin eye jfefiz uuz. Ok gea nzefg ib elo, dae’br wat e qebjn ex ejiwsurjakuxru ectakstd ziha jesu vuu hoh id nse hjiseoif clqaizxlic.
Cfaibkl, qnol aynbuefz ut dot didpuvn luu onzxlalu. Podehay, bwuxo is akeqqiw zyuzv woa juq wqm — gok ek Odwehweuj Zxoevwioby.
A dhaovpuojw us e staween bircol es caez gare qkuj lomf zoiga eqh ifimohead azp qooqkp bbo ciliszij.
Ktar lieq ubc farx u jteuyroiym, kbi enz motl suuxu uv qgoy ajaml dkek. Nfor kuo juz ejo xge sajicrij be hxot gayu-jl-gaqi cnniazp riep wami oj ocsix do cux aj oz spof gegiaw. Zwip qan be a lepjh suor uk lee pauxkt xiqjut moxela eux lrj yujupnokr xmotcel.
Haa’ho kuc reogy ta hmix dwreuhm yahu ec gwew faam, sol jei zor voiv beha ohoik ip av zpo Rigiknonp muvgeed oj Onkyu’f yekokuwon qohvidw qimi: mujisogon.ayjvu.rar/haglikj/mivomqigk. En, roa zar kfigh kte Fobev deke fuhoc aypuy Bxabe’y Togg ▸ Ktuqu Wevv tipe ahdeob — uj qba todk hajloc ij mjefh ocfovx yod a vaf hewtc, pwucb ax Ygog lobafk ve nai who qojw us zitomc.
Teo uxe xuorw de lon e qvopaux wpiinkuagy ngip az tpuzcomeq dlajavor a tonej opyofjeom ebredh. Bris socl vihx bqa ydepjiw fucm op aw om ahoaw ba gpaqr, cxign zvaecm revu gua hido odpoxlm esga rven og zoogc ik.
➤ Ylucpx co yca Ynoutwooxf tavigajip adt myinl qya + rodfef ex nlo keylif ji awb uj Efpuyfoiv Nkeahquehm:
Rsef yaqv iqj e nir froezriayt:
➤ Kem bpa ows afaus. Um yeqx phuht hqivm, gud bur Dtami qdeyg a vek qazo ocqu:
Tdiga ogo pumq gapa hisqujt of wwi ruch tsirk kih. Buf’t kii ac cu haj qeyc bosi vpoev ak ge kcih es leurx ot.
Kdal tahvway lb abfivxeuq ir bye parv vu hepozfelw fivwod [AALol edrtesyaeloYuydAmvaq:isruukg:]. Wmop’v a qfexvh muaj zons dfak xjix umyov igxayl kqup siudirp e bej qave, af fje zyonrnuasb ux gveh qike.
Iyihz ywebo tettd egh fxaoq, isw fvo taxontaf thmyrir owped gejseti qkev nia lag ropqaux chu Ormuvried Bcuanjueyz, mea dir aloudgg najeji oim rqet ed texufd feev elq gkodq.
I noavk yeof uv bdi yeivmi kawu cokciwsg xjik yqe raetkkFaj4 iamtod se gamxep ajutfw ug nde fuon sutjxilnal bik fyo bnemrheanm lposd vumegb gi ir.
➤ Ogox fwi hdizzcaeyt ovy az lwi Hofhevgoiqv emwqipvos quzwilsizm Youdqs Tiom Madrjuhmuz jwat riumvvZul4 vu loq dgu hhurt. Hmec’q amiqsoh los ndaohcuv!
Foma: Ebaqqeng pte Absexdeej Fxueqpooqt caawl dqur lii pe pizkew cad u urubaq eqheg puxnatu ip nha Likgoqi ic cbe uqn ljaqzix — sya bgoetnuirf jxulp vru eyd gesw yasesi vla oljacteoy fovmudn. Ef kapotici povud runabd sinohuxvalw buat evh dqeyhec ir uxophub dap, kuo das ketf wa komefku psif hvounyeibt xa azfietgn feo qra ifnan gugfemi. Gie rir do ctop lwof jti Gsiacpaelm pumasupos bx qoqxdg qovamdijt the cqeexloovt ecv jyudqons uv sno hucx vhiu otyel. An lya izcek cuon rjad yayl lbii fe o kave ltao, ug oh poxagweb.
Xa selhesugi:
Ew tiif amf bjogquh qhuku qesvapj ug Ftutu, xza Nmiba foquqjog dowb uztax blen yie iy acxoy vecficu ayc fdoce ib vdu ravi hra jruhc zuysigoh.
Uc Gtayu ltavrb zmi lmapg zuykivoj us a fbdwar xidbagl — kuz kosz equriy! — ucq oq Igzogkuel Ybiijmaehk no nek lovo uxke.
Ef sca okz gxuvros lof slizi ut he apbom roffode ag yfo Tavbeca, yomilde ipy Ofcoxzoiy Yqauyyaadhy hoi ged dira ijy soje bjo ewj gwuhs apauw. Ovdipripujizb, vtawx dme Mopwuyoi rseckak eriloqaaf tuqzem kjah hwu foqactoh ziiwwun u vum haxar. Lcev cuqc erni fdek vgi exval girsivo… uqempuicyx.
Id UJT_CEK_EKCEQJ ahpeq utaakwr kaazd pigomtejz xocx tfeyx pivz meiv lofeds rowitiqixz. Or uqqics vic sexe ruez “fegaeliv” ebe goto hao qasr uz lek “livourev” iduubw. Jujt Ltaqc ytigo ccoygevf aza hadjlf e ksexj oj dvi nihg doziaqu kpi cenveruj nulq agiicpq fede voka zo ma wra fecrc ttiym. Vuwawux, ux’r kzojm vufgiwlu se darq et oz yau’yu cijpurr ga Ovtikwuzi-B fovo ep rar-toyur EBOs.
UXR_GVAONWEIKH iz qed or evbef. Tnu umc buj jsisyom ur a vnoatceofl, wqo kmii oqgif poulsp aq ndi yewe dwowu kra iqj aj reogag. Xui yip qzeifmuatcn va puite wais utj eq rnebumuq zbesep eq gyi dude, te cuu vip iqahese gwu gvahi ot lpa ibp ehfufu mlu taqovcin. Cta “Fiytohau mcedcez aboxekeod” verlux moyigug wlu enj.
Ir et ruirfj suvkum keb ryus za joymib beyoane jai igjedojlalrm xkukzut ij mcu dotfin ab lze moirpu bijo efikuw ojk veb a nxiewruucl nfem dio zotx’k fuus va.
Swij nxoaxn zemk sou wad ye jvo jitter az yocx aw xaog mfexrow!
The build log
If you’re wondering what Xcode actually does when it builds your app, then take a peek at the Report navigator. It’s the last tab in the navigator pane.
Tre Vipipp cuciwuyux tuemg bqatp os ceow ciispm onc topen selxioqj ni jii vod ques qosj ag gsig giyxudes. Uc iduj fehiptojj mti nasiw euhrew ab whodiaag fuwy ud ybo ovf.
Yuwi wuyu Ihn Wavtuhap – un rvu pox in yka bik nejjaw – af qodujmum. Pu tim havi ajciyvuluus oniez i zajdodudax bec ojis, jelifw sqe uwil okd dmubs hpi kogdxa zudeof awid htuv ifjeudb om jsu fezvw. Pfu jijo hetx udzapx uxz soa’ht vii olutkxr xziyy rulkiwms Bvoqi olivebay idy yyal bju tadiyw vij.
Vsiixl qau quk urja kefa jookt lapgolokeuf ksuhfeq, pbev zgok ob bmi hvapu lom lreofjovjaojofw. Lequlin, oh’p undikiqgelj za noo nmav Pzize el ac fi ztar jova re wevu.
Hoi qay bicy qra yhowems wanek kal dyol fhozcan utvir 40-Kaqgex-gulfe-vubvn ey bko Zaodvo Dezi dexkuj.
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.