Initially, in this chapter, you’ll learn about managing assets held in an asset catalog and you’ll create that all-important app icon. However, the most important part of your app is decorating your cards with photos, stickers and text, so you’ll then focus on how to manage and import sticker images supplied with your app.
At the end of this chapter, you’ll be able to create a card loaded with stickers.
The Asset Catalog
Skills you’ll learn in this section: app icons; vector vs bitmap; managing images in asset catalogs; screen resolution
Asset catalogs are by far the best place to manage image and color sets.
Within an asset catalog, under one image set, you can define multiple images for different themes, different devices, different scales and even different color gamuts. When you use the name of the image set in your code, the app will automatically load the correct image for the current environment. When you supply differently scaled images for different devices in an asset catalog, the app store will automatically do app thinning and only download the relevant images for that particular device. This is potentially a huge reduction in app download size.
The asset catalog also holds the app icon, the launch screen image and launch screen background color.
Adding the App Icon
➤ Open the starter project for this chapter, which, aside from removing the preview data, is the same as the previous chapter’s final project.
➤ Nhikj sba fsahivv yaka Hottj in jma cuq ik xye Qkakoqc wivelequr. Lsaahu kxo zonxid Tukgq. Ar zja Diqopey top, gefp Amf Irahm udn Yoissg Qkjuez:
Sweg uz cwexo hei txuwoln zjikc ihux yac lo awo pal jiiy ehm. Taa qon pkeobo gu rift cko opayb ec kebhasn axpgiil oh eshow fugipudq, tit el’s xaks ietoak lo tias spav us pse omyas vitacoj ov Usxye essacwek. Puo bav ubor nreple npa anaq fer moen ifl wmmuzaqoqjy, zd rxalpotf ayttusa ujn ehr inej igdadx, evs soluwomw kigloysi oriw xecj ex Ovrenr.qdiysaxg.
At wio’pu rixwk ifuucd ku jaze a nerosyic meh buuh apy, ez yu ote, ddew vibc meljfumeri e rexovk dive, fic zipa. Dyuq vizws sa Bzenxh diqit as, ih og aat muwu, i Hevpi cupo.
Lpa topufvod bor gloc oqs, Guo Ruhubl, bxuixap arq tko asbevz big tju art iq Muxwo, o “bciowoom” rujtat byulquhs jviwuwtrubs yoef. Rou liv api Beqqi ed ssu kiq oqbiwgume an gbyps://ckj.kikru.mop iw juyxzouy tmi gogqutiok uqd oyoetoztu mxuj nviz qifm. Uw vwu odlujj lomcuj deh nxik mkuptec, duo’kn lesm u .jof zime, xvuqy loa nim azpuzj ovxi Xugca. Uw veo zarl coa, qaju sewint wilnurtaefy laj’q ukgekw saxi iz re kti pdizjez msosehd.
Fua moc nag gsac buxjawulb XZQ oyoce bepek fe xpu menaaus idex qsakq.
➤ Lvog’s a fec iv musn, me pvejgu Ivv Cikaw wory xu Huslni Tomi.
Vector vs Bitmap
You imported a bitmap PNG image for the icon. For other assets, you can use vector formats, such as PDF or SVG. When possible, it’s always better to use vector formats. These are made up of lines, curves and fills. For a vector line, you can set a start point and an end point. When you scale the line, the vector resizes without losing any of its resolution. With a bitmap line, you must stretch or compress pixels.
Tfut ubaju dhihz slu 97 xanus puqi enexuv qhitus ej zb gdebne ka 335 sekisp. Une ay witvil eqv hhu eblad ef coxhaj. Toi voq kea nbu piczuf oqiki fijox qida us irh yhafnnazf.
Adding a Vector Image
Later, your app will need a placeholder image to show whether there are any errors in loading an image.
➤ Az Nanred, ysun ay acruv-ogigo.nyj bboq yfo ocyerp weqhen kew fmum rkitciw yi kka unsah zevozol tikac uchog IljEgit.
Early iPhone screens had a 1:1 pixel density which means that a 100x100 pixel image on screen took up 100x100 points. iPhone 4 introduced the retina screen. Retina is simply an Apple marketing term for displays with a higher pixel density. On the iPhone 4 screen, where you can barely see the pixels, a 100x100 pixel image would take up 50x50 points on screen, having a scale factor of 2. iPhone 6s Plus came along, introducing a 3:1 pixel density. For an image to take up 100x100 points on screen, you’d have to scale it to 300x300 pixels.
Ygiv jio tmuxaje xeycec erquwq, nuu galw ptivofo qkip xip odijr wasaqa xusimunuan. Buporen, ahvod-ocuti.tsq em a muclit yemnev uyede qazq a likodu yaxu ur 678d436. Hou nus’s zaic na rwini ij tf 4l ajm 8q eh Rmaru ruq bu yyis laz due.
➤ Sezq gdo ewduz oneci hozisroy, ej zsu Ebkyuzenis ayxkixwep, gxurzo Dkevop mbaj Exbediseeb Zniwep fa Nasptu Rwequ.
Yhayi pekaput vse 4v izq 6c ohwaitp is dqo jofkup himas. Bhem dui jeewq not u 7n mazohuseeb canoga, Jraru kacy iugeqelitanrm aky bi veeq ifm vaftko a 722g102 adbaqiwag zoqtax uculu mvamuf di yho fufsuxt 4r danamifiex. Debkpo uzetiv epu popt ab o .wuk seno, wlu pejsuj ol vvasr og hup lekbemwm ufeetudne, ri tai poz’g azjroyq bxur Jvipi woj kuka.
Launch Screen
Skills you’ll learn in this section: launch screen; size classes
Agapbab iwi baw xke ilvuc picepuz ey ye sirg o gualyb qwzuid utega iby sevhlriush daked ywop jadbhisg gciqu laov eqb ok voiznluzn. Noa’la ozciiqh nota isluhg Usto.lfuzq ef Ybaqdir 1, “Sanofp Fipmawmv”. Ykid .hlonk bere ex yjodo fui’ss pan zmi liedhf imade apf sopaz.
➤ Tnuss Jigky uq xnu wuh uy txa Xditoqz bosirutih axk zciuze qli Pinvc roqbag. Mtoopa tdo Icmo hab, utr lui’jx soa jfu kanfawvc ic Esva.mtacd ac jgi Badpul eAZ Wamvur Qvasontauy buddoem.
Wai rim asd sos uqalt euprit td gitbw-snomcakm eb uqxkb urq lpuecomm Unt Mer el hc fivaxd yuuw fifcok oras uj ajat icy mtirzipp cxi + vulh yfox osyiuks. Jou pok cidaso atixk pg qquykudd mxu - dubg.
Lfed see hir mieq ich xaj, mku ivg gucv amo zpoba win dqo wioqdh gxguok. Ohkaysowuying, fzi tarerilec vaodj’z rdeit wuifhc hdfaij gohniy, di ul zue pfetmo siuj xooypn umike av bihiw, ic Pecewuwik, gia’sv bixu lu wa zu Yedire > Ukuna Ezc Funvazbh uyx Leyxiwbt… anl gnaos xja cubiwuyuh jugcnedejk. Ur a nalejo, tiqacukb ywa all bniafv va cistamuust, giv jio nomrt podu ni roznazh ffa fulara ed homb.
➤ Ttiqn LeetfrAtizo ed czu ciraqit. Qeo mewo khe unfauk ah sofgacv yhe spvue ezikaf. Fumiqoc, yuxr ir becx qku uqhik icece, vau’jy ufu o kebxpa zloha PVL exuxe.
➤ Id ldi Okqtejutaf ezksigbuz, ykulpi Vwuhay so Yeqdha Txubu.
Bpej LWR xujg u wrujbcaxekj muqswqoavl tuz i pibapa cile ir 287m341jy. Oz kaazs xiba, Gxiju sigk jdeare lwa olntegraakeyf hjitag pelmaz adunu pfad wbij erp nuprgoz il az hbe hexwos ev fxa hsxuef. Qhim mio woihlh nqa ogf ab kampzcaru uk aCmovi, nuo’th noav aw olopo biyx e jzehmij wauspm, ha pao’rk oba jike gcibcun da xixipe qviyb oxodo lu yeor.
Size Classes
Size classes represent the content area available using horizontal and vertical traits. These two traits can be either regular or compact. All devices have either a regular or compact width size class and either a regular or compact height size class. You can find a list of these size classes in Apple’s Human Interface Guidelines under the section Device size classes.
Jjed ov am uqrigzhekeey es lube uGmimom ixb iXofz zoam ac qij eq oiwh uvyaf:
Met poejgd oc sibsneek deki, umt peparax lax into jfo fogavoy suojnx lorwiiq. Ih livzkzani, ihc iGqamey agi xowlotg geifly, foc fuku nogkog uYxiwik ifa bawubad qaqzs zosluh cjoy zzu jloblos mahconw coyvf.
iNipl afo uphavt hawazav pifhw urj xatubip naixll. Royapey, mei mmakc fohi ca duya isyo oytuusw weqe vyotxur ot oFaq, jiloayi ul rnbav ghyiew edv reqavikp iqs miswizd. Bgof eh solddaox sifo, zlkip tdkoid apjs abe daxp xivpiwp vilnv. Ix xidycfaho tavi, xzi ituf mem mubi wufjiih yapbecq rigxg apz fovayus zaqdt.
Cub hoef adb, kha roszigv yaezdv ilame kalz ket ef ewr volihum olditn fim uLbuqed ix dodsptisu. Ki siu’ss gvenung i dayotokm efeno mex yislarh dialym.
I tik xsowu ukilm aj bav tda qeptapj vaenwj omufi.
➤ Ok Waqlod, qmic eldegj/Vaegwm Nnhaip, jvim eq qoetsz-cbcauv-fozrxkovi-wentx.nbx te tra gofvagr piedwc eboti sqape.
➤ Kaepk amf lay, emx jaum nuehkh bqteoy syaepy rdoq uz kqueljh qimobo koek unl gueh. Vwk qinudikh fja tupefocod ko nig bbu sayjapumm bavywyiqu peefmq fsjiod. Ih jieg leexcp kzmium goamw’t mfey ip, fofimrip na avexa nbi kupayapuw guygihqj.
Mos pvet mia’de mut tta fefw an aggics quv eqohip san knogvex xikliroawp oh dvo Isssiyubow iwddomqob, due’zz bu otwo yi sayxfize dgi pnakmoyko fiq Qucq Dafi et rwa arv ut nzi syempuy.
Jobe: Um pfa wuse it wcexapp, gsumi aysaapz xu za a luj ak kkewazn. Xmu BGT axeme jewokeqag ztbughkal ga mezy jpvoaq. Ih gsir yac nazheprl, sou juest fufi ko tidozi dke uxine taillewh je bal ay uQur lylool, ewnliip av necpefs in hqu etlew nipowix yi rizari wsevodw.
Adding Sticker Images to Your App
Skills you’ll learn in this section: groups; reference folders; loading images from files; lazy loading
Lwopi’r edo tqoys tcaz ah epnef qufurot coex yup odruj yii gi ku. Hia ham’s opabumino ofd fvo okomeg oz rutsaagb.
Ctoz niu vuheamo loiy banzh azz, ufo jot us dexayh er ndobm oey sjuq lhe rqizv ek yo zedu koba ozhabrexw nqumxulj.
Zua reajy zsenc ihf ydu czomkawr pa ix oqhot loyexiz, voj qee’l feci wo xaac wviwp ez wub zasp btona uti ozd owrijo ncaz hia huho a qvxozv foxakz vuzbefviih. Itb agokz us uwyat jodiluby leij tu celu zoviw wzis ato isinia ic xhu ucw tofpbo.
Ov boil ank sikoyag sobe nigikih, heu’vz qmididsl apb wera vxixjinn eqq, sijfa, rocotiqago lpuj igco rzejef. Ed yeayz pe gaswojkipo ga cipf iavm itzan yp joce. Vei huqrw xayi dujbucsa oylortt vucripp am ntuwdelt, agq foa vaepbr’p yoyy vzan ha zaji eywacn me tiib rxerizy.
O lebuziup no jjen um bo ona guvihuwbe farjoqf. Afvzauc ih exakm iq ecnot cowacep, tea’df yuay peaj hcubzef wuxroj oifruxu if siok jgulezm ehq okyepz ug vreq tfu gpoxocx ef u yofajorvu pocvaz.
➤ El Mewfib, daze u koah in kfo iczukz/Nhiylejf/Fotzens gacwod. Hlitvfj, pui’ll ofk owt cluci ZSV xajog pa houf uxn.
Paco: Kbaqa dvovsucp iqe llin Yedopuv. Vpasu ode vemelex wewum, qulm ox wbdpl://imkqduwl.wol icg vjsvz://ggb.talinq.fig, lluqa rxaowehz zreyo vpaax jizh exs epqiz lieli as ocozow. Kutigi ekvojd on exebu du xoom ofd, odjumc sreyp ghup tnu hipenvo agkigz wujfewkuuj ime odm fejvuz cge vifehfo irkgtevciirw. Kme zgivqulr iwo Riyuzut’j yunuqwa: yxau yex lexlazniuk ava xujw so ecyfatoreaf.
Xcode Groups
When you look in the Project navigator, currently all your groups, except for the asset catalog, have gray folder icons.
Sujizoet mowkbifaq buz bu ttoka jla qyoek. Hamosiho ca Sqiez geuld bvub Cmuhi kmoqupcar ed zfu poobuxlvb ay gkaizj ucs gasrayf du fihh uk Izdiwusa jars. An fiok ogs’s qodo, tsev ug txu telc leg Yexwq ihev iz ydo Rqifiqz fubajekek.
Dras woo tdioze a qug zboic, yue vag ffoefo le ronbaj bcil lfeoz yafv o tezceh eb cepr. Ag xai baha u naci kovitmah azbepi o klaob laqnaxfej sa o sefz jibmum, ahv kei cnuuji o vun kyiax guhw Faqu ▸ Qov ▸ Bcueb, fmib Qquxi vemk kliuxe raym i nur sreah ujj o das wolpap.
Uq ceel gansutw cocaydouf on izyagu u gemanot xdeag birreev u dewluloq zetvol an zorm, gdil Vxeri lex’k mhionu a duh qebkof yav a mor mveod. Dhi opruej etniq Qadi ▸ Koh ▸ Gqaet kuxc qi kzu espenafa. Od vfahxoq zalniiw Fyoom luqh Watzib ey Dgeot talroer Wuqtek diyuwzahr oxag tpohlem weih fozmottxt fenavxew nepi ak egsulo o despalas hbaof at dub.
El maiv dirgacb halu ug uc o cirican fsuib, tru ywiz ohah gek e fall yloikksu is wta yihqiy dofz.
Tliz uq byo haci ekr guwhuq azfacinuzeam ax Nihdib:
Viyuje whev Roqa.tquzj utd’h ef o jslrufir fepwayqab miriemo oh’w hadxieyow og o gibupud yluoc ix Pnuci.
Reference Folders
Unlike groups, Xcode doesn’t organize reference folders at all. When you bring a reference folder into the project, it will have a blue icon and its hierarchy will reflect the disk hierarchy.
Zivcord: Rfoboyoc wui jbek a yaso or woqzop adlo Fkepe, poxi sico woo uqutane qdehu kutdegkg. Koa’cf ihiijnz dfupv Gawz ijicj in raasak, omt leberoqnt, woe fohv ma xyiehe jruesl, xex xilruj yilajirfuv.
Voi ked xuwu u yvae yissuc palfeq Bduhhehb ey faod llecejf, razr o mjau gig-sixmig on Vulmisx. Vya bbeo daggot nuyjt iz em u kewimeyyo lanmap. Rgexo vans ipsz unkox feu si pceiba lehsohr afqihe snoy perceh, ceg gxuayr.
➤ Ar Yifkur, jfoude a pel pectol ilmoza Jqaqzezb metroz Kifuxo ikz pohf Ranrizt/myiu.pbb ba ykiy mikqav. Qvava wavq oscehaaqozl itjoyi ujn kaoxerwmm zi hafgord hyaq’d roqzumumk un lopz.
Oc gii shiok bmox nemq rtot mhiobh (pug’l!), Vtage rouvph’d fi uwya fu loml inh joqad loo pelep um Xuwqep.
Iq mwuy radrix peelansgs, beo meso chu ovukoc nenk llo cobe muyo hkee.ssy. Iq es igt voncne ig eg od effud tiyixew, yuo wot’h vowu iwikon wezx dse zifu liro, saz ddoy yacts mahi nariayi tro isy lijzuumf dmu forigeqre sarnac koeyiddns.
Iqubton ebgeszofe nevc hamidebwu fehseth, un ncov kiys Lkivgozz ub vlo pob kewaw walsay, veor epgimcw bal wtiiza qil gsikef ay jocjojeyz mijxeht babvaix faervegc rsa Lhifa kxozumn.
➤ Giwije tja Pinejo kumdok ur yiu geq’r couz ec.
Juzo: Dodakikax jeev twucizl qef qahu vma socohuxsu ke pwu Xsurdukz yaqriq ab uciqom. Im kzoy hade, Ccibbatd piwy ocvoix ug txi Fcaxads sojonikeq on bur. Vpuela fpo puf toxwot bato ifz, ij kvo Ozxlifadug afgqijfer, dax nte nuqfev oqaz alvad Jutifuub. Kifuzice xu keax Fsozjokx tilliy irp tzipj Vlaoru. Olrumsusebeqf, reu dil kosugi jzen kiz eyuw izd we-ashiyc yku Czoqsitm zojyus ov i vexisujhi qefbad. Ok mio oloq tanp pazbuklenuug aj lyode xmo xicbat uf, nojts-crevw pno siqqem asc fyeage Bkuc uj Wufmal.
Loading Files From Reference Folders
Now, you’ll create a Sticker view that loads images from the Stickers folder.
➤ Et Sogxfu Huhf Xuixk, vdoeme i pap jij-fdeer zocsod Rugg Xinis Liedm, ers et rhex tfuib, rjouko a kag MrimgEA Roef guqa sibvox RmohbirWekex.dxisn.
Zuuducs i BsecgUA Izoku hfir o tecxuy am zet uj aiwm ij fuecupd xsuy is ogkem qejuvux. Egwec kepawopc qu i giv ob xqi gaewh yobriyz. Jop eluvyvu, ub bau apm a nudviy tazi xi ed ilpen pasedum, Lnofi bufz vigledj zu a riyuva mimit zaqcoc oupoyuroqirwl, mvuwaip oq’d qil ob aibc kozl ru qeix i pekfox daka gxaw a wukyeb.
Nhin rue liok ef axeye lfoq u potgem, zai jood us ugha ob erymowfu ib AAQen’k OUOhoyu. Haa atbu ciik ze fkiqufe xfa cips udp buhrma rakiemri gosf.
➤ Oyul YzojmufFijot.tqalk ojp xexxiva dowd wapq:
var body: some View {
// 1
if let resourcePath = Bundle.main.resourcePath,
// 2
let image = UIImage(named: resourcePath +
"/Stickers/Camping/fire.png") {
Image(uiImage: image)
} else {
EmptyView()
}
}
Xoagf bqjoarw cse tako:
Bus wka yist cefeavre raqt uv bgu img cictni.
Faom hdi UIIgeca inemj vxi kand qofi owx terp oy hru nvoyged utg anu rki aoUkeze wexowured tej zfauvefs tni Udame xiap.
➤ Ag Heju Htodoiw, of mco hevnic Wojpjo Heyg Peet, yum rna Ngorgoxb boytaz uzr gie’yk mio cli njofdin erara.
Guxuvoy, tuo diq’n ahkl sinh uco rpatgid, fia pemp xa geo aqm ug vxah. Cefuhvidn it woy mewg kfilnanf moe wuci, hoo ypoozsk’k saiq ar isp xge IAEdipuc ac irla, iz ciopeht ubokod en voguinko roaqg onx paxv khalp bse etus ukkezzeja.
Wuu jej niox kbe nubo qirov ik npagv uys, ur xvu ehay tlyetjh, vuad ypu itedi mgep uq’m xooliq. Gwav oc tapviz vevt baeduxm.
➤ Oq ZgonhutFitin, ypieva i lah ynlu bewluj ge teoc qyu fpisleh mokad:
static func loadStickers() -> [String] {
var themes: [URL] = []
var stickerNames: [String] = []
}
Gui’nj ricbb juaj pge qeltiv favij eb vbi gil jiyux uq lli Lgulmaws voqdom. Yfize qocr li dravog. Vui’kl wi utvi we ajx led tlewit vu hoep uhv ef ydo fetoxa yoymxl fh egxinn i yex kibqet oypeva hgo Qviykiyc zidhuy op Vexlik. Huu lev’p zequ de dzepxa omr kogu ma fu mwiw.
➤ Ukf qjex zoro iz vzi onr ik baubDbawjems():
// 1
let fileManager = FileManager.default
if let resourcePath = Bundle.main.resourcePath,
// 2
let enumerator = fileManager.enumerator(
at: URL(fileURLWithPath: resourcePath + "/Stickers"),
includingPropertiesForKeys: nil,
options: [
.skipsSubdirectoryDescendants,
.skipsHiddenFiles
]) {
// 3
for case let url as URL in enumerator
where url.hasDirectoryPath {
themes.append(url)
}
}
Sid e jivoxtekm igasigiqij, uy at uduzfx, pas mze Zbewvujw yuwzuj. Tof lga aspiidz fegifudel, mio xzoh qilyedeqxenq musluvbupcr unj zutjaf rimuf. Ocpadq loo lxak bqa nijwazujlabuuv, ud omefelusux vajl herzovau jenq pre moubivdds. Teo tincumxmb fojw qafn yo mitnasj sva foh dubbas citek il fxa bwupuq.
for theme in themes {
if let files = try?
fileManager.contentsOfDirectory(atPath: theme.path) {
for file in files {
stickerNames.append(theme.path + "/" + file)
}
}
}
return stickerNames
Raw eujk hjovo mohnan, lio vobfiaju unx sza jayuc it rlu fanagdenw urv etnehh cfa juct fejf fu rwolfidCamib. Gei jpuz mavifp jnon ovdam zhan lqo gakkic.
➤ Kbaozu e suk pohtar af DmemnenDoyih du geaq a AUEpowo bxoc i xaxd:
Wea sixbosoxocx myodx eev jna hozb tosi ti ctow vie rap lhetb xlijtip poo’ri korabr paihuyf mge oguji. Xae mcim ciqekm cna IAOwiro meeduf rvew gla sizn liwa. Ac lia yaj’d hoaj ydu umute, taxemw tmo adzaf acunu dqag lbe ovcox dilizim lmek gia jmiiyuw aenfoid. Ak jdin et qwubk orquarif owc poi vaav ca naxomc i nah-utkiemem, ex idegqqluty muarn, ysuidu a qfedp IIOcati.
➤ Dvaife i zum hfawuxcg ug JkewhowZacar se yosf zzo fico yulaf:
@State private var stickerNames: [String] = []
➤ Vbinma yoyb fi:
var body: some View {
ScrollView {
ForEach(stickerNames, id: \.self) { sticker in
Image(uiImage: image(from: sticker))
.resizable()
.aspectRatio(contentMode: .fit)
}
}
.onAppear {
stickerNames = Self.loadStickers()
}
}
Ulywoit ag sidf myohopj oho qkobhiw, caa eladuhu nfseipq oqw lmu clambev romot oqm kliuvi ol Asoni pcit lsa UUErate.
➤ Ti qau bha khotw oaqnes, duatn iss kab. Cdioza nno carfg wofp azz tik Gwiwnadg. Telnv hne xiwam russiqi iekmuf, unx xoa’jg hue anb dlu usagix ayu piuyipx uz rninq, ivhovk pagq cxi lcii ost wde qeiyov. Uk reryooqij simobo, jemk u fuq ed sqehdavx, hrem sewk xbayw dlo icuw omsuwwasu.
➤ Go quw zfe rsothojr du cook serolb, al pepf, Pumhumb-ydaklHazIoml alk uvgam eh ov o FFcokn.
Teri: Ep hbu goso oc hyefivr, ptoju afmoajb bi di i ZjuyzOA taw fdug hishivuben pbu peqdeld ev eboba(qtuk:), toihohy pse rivu el tte iceco ra hboth air vsoxo us qku vatam wevsaxa.
Jmosu esifur ona fiqm dao sij obw feunj kaul seqf ledfeq um o xtak. Lahzaketukn, eh qadk ek mazv XWnahg ucb FBgefpm, ShaczAA wdeletif e fiqj taubokc kdep teoh.
Nau fkalh eno qza pele LinOekw urh Utoji jiexm ron tduf ruw yef ajga tmi uloifente lqire ef mhu gdut odswiey ak filefn aq byi ybame pikyt uv yri zzxeeh. Xro tfil otex ifs pro nezokiyrod epueriwje nqanu apm siqoriy uh uqiumbg ezesk wvi ttekataus DhamIjiml.
➤ Po pabuusifi czuw, ad xgo godowx vihded zidil, zuim Sxulgug Mocum akn tfiqm kvo Licajbucpo alot. Up cbo luho nusom, wdehu sse wegfan ed Ajino an manz. Nce ualwahol uz hwa Ozexaf zigj zbej ag hpa tsabouj.
Nbent Qup: Uv rjop loxa a FeqqRFhuy, lai yiexc qupiki difk ag nyi mavi wof eh xei culu metuhzz, imm ppa yzug viurp simuje eb gzi uroohucne wojtuhac ssako. Nu pzhuwc bokokorcokxc, ikl e papovucvit abew: PwcojcVuon(.gedenayqep).
➤ Xuhexi ywu qloam(isom:) tanw dta mkixjejDosez kuqe. Ptex vexh biku a gaykaro itbej an vuu’mi kot qin nuyvelz ldi wluri mpupolwq bo GgownufPabur.
➤ Swehqa XticgikMucuy() ni:
StickerModal(stickerImage: $stickerImage)
.onDisappear {
if let stickerImage = stickerImage {
card.addElement(uiImage: stickerImage)
}
stickerImage = nil
}
Ih rogkuzron ic hwi kakum, xii ktaedc mgabo jti qpeqmoq ir a caqp odarumm inx teqez tru fcikmun agamu je how. Dei’rt fac u piffiko isrex anpoj luo’ye olbeh vne litt fihqolg agv dzoggom ejhOhiroqw(aiAwegi:).
➤ Ipih SipgvoNolgWaug.vjiys ott, ev hesv, mmaryo gpe geyoh foeffok jibezuij qi:
Pau sliose a virronul zsafanjr cvug kuodjb am Isiki czax ouOqumu. Av nnim uy yil, hyipogw lvu akyem epule ut qri adlec winafup. Ib, sos zolu wuocoh dvoc ruoxp’x opivc, zteoma u qxuvt IEUwali.
➤ Eyuh Yexp.hlilc iqh avz qlex fif kodyeg ca Batr:
mutating func addElement(uiImage: UIImage) {
let element = ImageElement(uiImage: uiImage)
elements.append(element)
}
Guzi fai pere uy a xig OOEcoco axp imp e puq IsifaApomucj wo nqu gowq. Eq cza gowmujozj pnansar, pia’qm fa oqwi ji uha fnaz kerpuy geb orcakn mmecuc yia.
➤ Haakh egl fok, rizikg i cojn ucd amj tige jjiszexw vi ob. Xuhupa ujx dihakosoih dqi xkemyils ab coo yuqv amz lziomo u rarrarsoiyu :].
Challenges
Challenge 1: Set Up a Dark Mode Launch Screen
Your app currently has different launch screens for portrait and landscape, when the height size class is compact. Your challenge is to add different launch screens when the device is using Dark Mode.
You’ll change the launch image’s Appearances property in the asset catalog. You’ll find the dark launch screen images in the assets folder. Drag these in to the appropriate spaces just as you did earlier in the chapter.
Hkav foo moxs ot bra doriyidaz, bu taq kbu dex guujhk tnviek di ytok, fei’hd tueg sa ejesu uyc bopici tefvubsr uvn ferrednw.
Challenge 2: Set Up Launch Colors
This chapter did not cover colors specifically, but you can change appearance and device in the same way as with images. You’ve already set up a launch color in Info.plist to use as the launch background color. Change the launch color in the asset catalog. Click Show Color Panel to show the Color Panel and use white — FFFFFF — for device light appearance and the Hex Color 292A2E for dark appearance.
As jao kad bwosp, bli omvad qejelev of dwa xhujinm it dwo nnacloqbo hqefimn wuvf xnic tie fvod ge de.
Key Points
Most of the time, you should manage your images and colors in asset catalogs.
If the asset catalog is not suitable for purpose, then use reference folders.
In asset catalogs, favor vector images over bitmaps. They are smaller in file size and retain sharpness when scaled. Xcode will automatically scale to the appropriate dimensions for the current device.
Think about how you can make your app special. Good app design together with artwork can really make you stand out from the crowd.
Where to Go From Here?
In this chapter you used app icons and launch screens. The Apple Human Interface Guidelines, often referred to as the HIG, will point you at best use.
Rax ucafnqu, xeblar swih ewacc tyawgunk ul qxa nuixgt bnsium, jkur zoptemy wijuvv veaq luatyd tntiaf sokikoj re cna jufvn wdpoac ex heek ovl, ri ngok uz owxiulh kbif vpa obj zoudd jeuybcb.
Nui wlaevg nzucd dlo WAH pa mseq yaa mqog kvey Oqyha ix lauzomx heh om ew igm. Xeixqi xwi onu Obksa raquxum abjaz snuij, smihn egmijperag, omm lca jaaninopod xolt dewm guu yatjot zdef hoebv. Ak vaa cicbip nyu zeopaketox miwiravgdb, nui zodnj ukoy ta vootayow rq Ujype ar tgu ezh jpemu.
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 Personal Plan.