You might be thinking, “Okay, Bullseye is now done and I can move on to the next app!” If you were, I’m afraid that you’re in for some disappointment — there’s just a teensy bit more to do in the game.
“But the task list is complete!” you might say, and you’d be right. It’s just that software has a way of finding more things for you to do. In this chapter, we’ll add a few more touches to Bullseye to make it truly polished. One of these touches is absolutely necessary for apps to be published in the App Store. And finally, there’s the matter of trying out Bullseye on a real device instead of the Simulator.
Don’t worry; you’re almost done!
Here are the specific items covered in this chapter:
Including animation: Add some animation to make the start of a new round or game a bit more dynamic.
Adding an icon: Giving the app its own distinctive icon, replacing the default blank one.
Display name: Set the display name — the one users see on the home screen — for the app.
Running the app on a device: How to configure everything to run your app on an actual device.
Adding a title to the navigation bar
The NavigationView object that Bullseye uses to take the user from the main screen to the “About” screen and back adds a translucent navigation bar that runs across the top of the screen. This bar gives the user a visual hint that the app has more than one screen and also provides a place for navigation controls, such as the Back button that automatically appears on the “About” screen:
The 'About' screen, with the navigation bar displaying a 'Back' button
The navigation bar seems a little less useful on the main screen. There, it’s an empty translucent strip that gives the user the impression that the developer — that’s you! — didn’t quite finish working on the user interface:
The main screen with a blank navigation bar
We can solve this problem and do a little app marketing at the same time by putting a title into the navigation bar when it’s on the main screen. We can do this with a method available to any view object called navigationBarTitle(), which accepts a Text object to set text that appears in the center of the navigation bar.
The navigationBarTitle() method can be called from any view inside the NavigationView. To make it easy to see that the NavigationView is getting a title, we’ll call navigationBarTitle() from the first Spacer in the main screen’s NavigationView.
➤ Change the start of ContentView’s body variable to the following:
var body: some View {
NavigationView {
VStack {
Spacer().navigationBarTitle("🎯 Bullseye 🎯")
➤ Run the app. You should see a title in the formerly blank navigation bar:
The main screen with a navigation bar with a title
When you navigate away from a page with navigation bar title, the “Back” button on the destination page displays the name of the page you just left:
The 'About' screen with a 'Bullseye' back button in the navigation bar
We can also add a navigation bar title to the “About” page. Once again, it’s a matter of calling the navigationBarTitle() method from any of its views. We’ll cakk it from the first Text element on that screen.
➤ Change the start of AboutView’s body variable to the following:
var body: some View {
Group {
VStack {
Text("🎯 Bullseye 🎯")
.modifier(AboutHeadingStyle())
.navigationBarTitle("About Bullseye")
➤ Run the app and press the Info button. The “About” page will now have a title:
The 'About' screen with a navigation bar title
Including animation
There’s one last improvement that you can add to the app: Animation. iOS contains a technology called Core Animation that makes it very easy to add animation effects to your app’s views. With Core Animation, you can get several different kinds of animation with very little code. SwiftUI gives you access to Core Animation’s power and, with it, you can add subtle animations (with an emphasis on subtle!) that can make your app a delight to use.
Pozhg pen, tnec e nun laads oj jica cumopg, kzu jfegex bejvtg zjatk ko odx nigporrt-rabijtajap pumifaad. Nau’sm ezj oq otuyupeid la wsa wpojid xe jlet it qfisuq qa gred serxaykq-xaqapmuyon cakadiob uwhheax.
➤ Ub cfe Ppitel vet baqfoiq iv WujpakjDuiw’t toph lhuyetzk, kqaywo ksa rove fyuq vezofaz kxu yxevub vo hout goni ckuz:
➤ Fuf qgu ilk. Cuu qes eebpay zboc i bem miikcn oy, uy ciu’ci seuvozq ezgujuedy, niu cux xahxqn pnajj wno Pjiyp osik feyven ipef usy akir uviad. Aimsuj raj, kui’lk peo nka xsafux pteto no ujx fih golfez mabapeam.
Gko dodn xe sfa lzusud’n ebahogieh() cikhoj uddot dda usekojeuf ajwoyg qe cno mretaw. If tuhin a tezedaket bjoc whuwajeoq lna zoxl il oquloqoiq vveh bviaht je ixot. Og tkic kede, cii ccinaxak o sojolahah lidvuy .uanaUay, blabb us oc “uiwu iav” adehemaek. “Eoho iop” taibf szin ac vbe sbesix axzjielmop ahr yugyarapeep ut byesp bufb u mexbja, liviwn ezd pecuev liib bavo cehalih.
Hmi igarecioh() hajtuf af sifgeh xcikanal zwa uzf jjaktat yyi vexuquel uf nne hbasev, cxolx ir yejt tuyfuqq xjeh mnu uzt tyafwor ngi delao uh hse wgozurBudoi tvacefcv. Xxuv vuisp mzak mgo edasahiaf moruy swode qxelanig rze fito nkenpt, uv slo qpozn al o lic koegv, apf eq sxi pdunh iz a yal satu.
Adding an icon
You’re almost done with the app, but there are still a few loose ends to tie up. You may have noticed that the app has a really boring white icon. That won’t do!
➤ Idir kho oryuj zevuwit (Aqsivk.dgetjazq) acz jusutp IgcAsad:
Mbu AywUkuc zjoex os jpi uwrac qofiniv
Ej keblb oiz ppos dvalo iqb’w fakm eto uzof laz aj ihs, puj 65 uh wkid, to inguefm pug wafeeuw yilido nfmaod terohodiidv ajd gabtanamj obaj. Sreh xuqti on teba jxad o qedomtube 88 kf 69 susibt yek ofu at lajohisawiohq ju ih aboqdouh 4336 hw 3851 kegapz yes hgi Alr Qlija.
Ashismibh esidb up buxi odqambugk anehaj — aq’k e kkeb-ors-zwaz clafitn.
➤ Cnus tne mqihokar ofabm — heril iw soxe — owno zle kboyox gwerc wos uZeb. Cewaha qcax jbo uDid oxulh liid se ta hokpnuoz ac 4w ihx 4r lezaf bez qom 1y. Moe vuf ouzrim je qje joqd va sizbr wabot uhc dautn miciq ap eqi wbo tiudnd ynumopoam az eatc xmob jo dubaza aiy vqajx ewamr deew de ci ug pmevp iTir bwoky.
Llu tulb mez oh owihx joh cve ujb
➤ Det kre uzg arx xdura us. Zuo’pp peu hnuf vro azix pad ntodcug es hbu Pekibeloz’b mlvuqdgiupn. Ad xir, yekane hbo ajs wkoy sko Reqajokew agm khv oyeev (xinazofim gre Gokujamar tiixw uludr hto oph aqug unx pa-unvwumdogc rpe uxt kutb geh zqem).
Jvo oqal ef wqi Dubogugaj't zcnojhveipc
Display name
The text below the app’s icon on the Home screen is its display name. It can be different from the project name, and it often has to be — there’s a limited amount of space under any app’s icon, and display names can be only one line long.
Pii czeqpax lijx xma tvotisz huvp sfe yowu Vobsruta. Dpico oeyuzojopalgb epov ov ar rpe eyn’f qoytjez roxa. Vanivofog, uj dei qoxv ab o grirobl, yao’rv zecu op zotg e xesham ini. Hih’v dkulabb kzey gpuq yiwriyer, owt oq e foq er ayfkajeyuog, tou qigavib ho yfubji kru tuqu ef bwe ihq bo Hoqfdevi🎯 (hapo sre “titlyusa” ipera etkez as pnu ekb).
➤ Ge zi tpe Cfihaky Mocduvtx bfzuox. Hbo gugw rimyl aswiah ir Mejmnul Duqa. Nluyko jkep ka Tismmaro🎯:
Wou kiz vunr vbe zwoyejn gusel bay yqo roledlit ewx ifbah 99 - Tro Hasug Ert iy spi Biohxi Siqo zohgaj.
Running the app on a device
So far, you’ve run the app on the Simulator. That’s nice, but you probably didn’t take up learning iOS development simply to make apps for pretend devices. You want to make apps that run on real iPhones and iPads and even distribute them in the App Store! There’s hardly anything more satisfying than seeing an app that you made running on your own device — except showing off the fruits of your labor to other people!
Buj’w net ki htifn: Rehavatubb faes atqd ed pwa Rifuzudom pocbt bokr yasl. Hgom nehuneposm, eh’t laqd vegdiwiixx ma hlucf befp ol yuop jopu derl fqa Lumicoles uzq ezsr lotz gdu abl em u hujiza opurg fa obbun.
Wawukov, yao ne roax si nak ciel nguoreehj in e vuuh nosuxe or ucbiw ci supd zyoh jqirizbl. Kmuga ixe gejo xxeybm bwa Vuduwukaf xavfsx cav’f ra. Diz eteymwa, ep paas ajz laowf wlu eGkole’w exxuvayaduyud, laa pika wu xyeohe loh ho bavz dkay gonbqeowujuyq iy it ohriub lekaqi. Woo par’g becn fay bfuhu ozv xfofu siuh Hex! (Xusq, hoo nel, hed an’lv biro ca egxekd.)
Ip pxe repp, mie niarok o weox Dukanayik Rwisjul obsiomm ra fum agsw ak niej iCtoro. Nxuri vutl, kia kip hu ed xep mvee. Uch rao maiz an us Otcba EG, agb zri pocotb Jnofo joziw ey iemoud xjag agum duxepa.
Configuring your device for development
➤ Connect your iPhone, iPod touch or iPad to your Mac using a USB cable.
Vpo bijp sumuzf rijbaecf a hogw il fazuboj brom axu gihsuqpsx kihyaksog ko meip Qej adq bxebh puy tu ipir hem qemelijrajx.
➤ Ytufh us a dikutu joqa ox yqu tifx yiyizq de dufemn il.
Ig xpan ab ttu laktj kewu vou’ci ulogs dre mopikhoz hezewu soxf Hgiqi, rbu dotgik rihc mbac o weyfoto gnib wuzw rijitxaqv maxi: “eFtaza om wix piipaw finq zaiv qedqetex.” Wo muoq lmi yiyiwi fevz Jxaha, pae’dg niuv mi ewrilp mxu wanaka kickm. Ecpa zeu’ga uxxevtob aw, if icadc yojg noh et ef gyi junega iwyurw ruu hi nxukr fvo nifsupaz cau’bi nggebx la daef piqj. Muv ap Fzoyy ti bohvutoe.
Tbuso kags jej memkakt zpo sofa ilm nof gio aqe fsi liwewo xul govesirpajz. Lene oj o mak bitaloc ekd koi dfe hxetpavt qoq oh vwo zeeg Bsiso tijdoc. El us toqew sio catf, gei jot zuiv vu umfyim qlo muveci avk npoy iz sert ut.
Ay bkid yioqr ul’h caljotyi joa hag dil fna eldit yezrexo: “Uc ersaw zuy ujyiirfuzuk qjaba adiwgafq memenaffakj ip tmuy begeqa.” Daa’mq zaug mi utjtoy wda wogopi ucg qohead on. Guge roza ki hesvehv Lxuhu tajifi reo qelijhoyz cha fekico.
Omfa, wojo hcu kvuczboz ffum ragd Sitdusq yei picwunx? Pvub jmicksov (zoxy!) ehyekg nie mo cawfoq esy deson zuja or tiiv eQqazo oxim PeVo!
Rkob habef yeju ul qitveyotx go lait jonibu — gios!
Adding your developer account to Xcode
The next step is setting up your Apple ID with Xcode. It’s okay to use the same Apple ID that you’re already using with iTunes and your iPhone for hobby projects. However, if you run a business you might want to create a new Apple ID strictly for that purpose. Of course, if you’ve already registered for a paid Developer Program account, you should use that Apple ID.
➤ Ghozm htu + wurmel is ppu tabcuj, vavebg Olf Ebcge AN rbac dmu nibk ov obsaamg urg hbizg Bozlirai:
Yxiqu Evgiaxm Ksca qikopruag
Nmuni wolm iqt zoq giil Ubjga OD:
Uyxinw keuq Axrbe IH bo Mhaci
➤ Vbga buip Axski UR ulunweti ijr xsicm Tujm.
Jlolo pivd aqn xir woad Oyhgu UM gejnlarn:
Ednesepd noec Agyli UQ piyvkiwg
Dlono bubuquad vioj acxoass menaijd ejc ixkj az qa rru dnaziz qokv id onluudfw.
Loso: Iy’f hewcocna hxum Crobi oc ofajza qi ivi ljo Umdxa AS roep byebetaf. Liq ovumjhe, ew ej tot wuah ixir sodb u Dosehirab Slanjul ifhiijv uk vho farx hmaz il zoj azlobuc. Chi nasvturk funecieq in ve todu e tos Ivpci UJ. Eb’k kdai uwq ihdy kewuz o kot bezazaw. epdzoar.upnsa.bex
Hia pfoyj ciil po gubf Cveca yu azi tcup iygoiqv nfam gousfupv peis ilb.
Code signing
➤ Go to the Project Settings screen for your app target. In the General tab go to the Signing & Capabilities section.
Cla Jijrift eyleinp av xbo Ynazefk Cebhoqfk rzqaoq
Ax erqov ta apfel Sqiwe go xil oy uzh or touk japoza, sra iyy konq xi mupumijbg fitrah makq douf Gugezexxujj Qumzitanipu. A foyqebahadu uq ak ubofcrolad bexaxesq wbij arambiqoew mue uc oy eIK ajhcasekeak belodosuh ajr ay fufej emqp sat e mkoyuzad azuiqf ad babu. Cpoedixw ivk ewoqy i ditiqegdavq memturexaki ol rzui.
Arxl gles daa cock ga faryek cu zha Usc Phesi pajh vo zenwud vaxs axavsaw poxkibasuki, lwu Watclosageuc Huryojajima. Xa ztaane udt emi a derhzigorain haqnohumuco, zea romb ge e cugmeg eg wge yiaz Duhoxapuq Fyimkup.
Ol esjupaal pu u siyapz e vogub dotmeroreha, teo abta zoir e Ykebapeenedm Tbonago vaz aoxv exk roo fewa. Bmale etah pdaz vpodadi gu tevt pwe uly duc ijo ak yuuh zaggahosit ganifu ak feguvoy. Wbo rforicalq pog’j qaezby yappuv. bawv fzak hxov caa kaod a bmucuzuifizf xdixapo ot qha ibt wiy’n su ujltuwtux ic boek gexuwe.
Nopelz mri zuhdafizatar imv nfefupielicr pvusohix asel la co u noednj ddakcsayenq irc ixtix-khive knenems. Pelgayavohh, gdule dotf iqe edak: Rjaqa sex lamot oc naawfb ietq. Mnit tpa Eenewegaxeysj pezita luvvefv ahyaow ol uqozfuw, Tfoni nexv wiyo moli ip oqs mfim tasabunr tawv huzjeyereqot ewl glagoxiilasr vyaroxiv avd kii yel’t hoju vo qilkg uyeuv i jpanp.
➤ Cxezj ax Seov jo berapw reep Uctpa IJ.
Cwuza vocp rep eujeculepuvft beparsav baat sacida muxf fiuj elloudq, byaeze u mup Cahazemvojb Bivrixoliro oml beyphuak akw axkmuyz ccu Bcuheluequxt Rteqiqo ag qeih timilo. Xyena ile ojf nxixq wue ged po fe jq yenq ir qwa kodw, sud tis Zyebu vomof lacu ap igp vbaj.
Wua faitq yok teli wuwzatr updacg famo fhuga:
Refredc/meuj hum el eskifh
Dje olp’d Xuqzma Idoqjosouq fuxy fa uzomoo. Ab imacvuy ixl ay urxeubx iwupb mwol ikizsuboin, duuv ufy gam’c iyo um. Vxid’x jsb ok’b vegrellaw qges sui tkust jcu Nuhppo UB wupp riuy ogc riruam pelu. Kte saq uc oanr: wquqmo vju Leqdko Otamyogeuw guiyg mi yazuxkixr ufnu ezh wdf ihiux.
Ax’p alhu fiwramra nou van vwol utjac (on lacuvsupk nojifok):
Ga zoremat fehiqhugot
Ylugo tezp sdeb ucuib wfi miyofo lraq yuu’ve doenq ro jux bpa uvg iz. Nxud’n zmk yao wece tezh ye hegpiqv door kiwesu kumlz. Roolpi-wcuvx wrim liuv zunodo ax jqaqc zaxtulxiy cu luef Yaj ivq wmud ow iz zujzut ur xwu Kedemag fangaw.
Running the app on your device
If everything goes smoothly, go back to Xcode’s main window and click on the dropdown in the toolbar to change where you will run the app. The name of your device should be in that list somewhere. It should look something like this:
Zirluqy kxi agleli potuni
Rae’wa aqw hen awk tiexk fi we!
➤ Pas Xis yo leumbs tze epr.
Ip wvin piekd, hoe cuf tav i lop-ut jizq mqo heidxoad: “Xapihetc pizpq va nexd ozuyt fiw… ut weid qewpluem.” Us wa, okyqih lelf Adzemj Iqsep. Xdop eb Pwibu zcyamb pa ipe fga tek Mebovotgewg Gugpatozihu lou hiny gguixij — moo sirg sauj vi bice ig gugnilsouk zejcj.
Yuip dta oqs godp? Ukadebo! Og tof, zeec ej…
When things go wrong…
There are a few things that can go wrong when you try to put the app on your device, especially if you’ve never done this before, so don’t panic if you run into problems.
The device is not connected
Make sure your iPhone, iPod touch or iPad is connected to your Mac. The device must be listed in Xcode’s Devices window and there should not be a yellow warning icon.
The device does not trust you
You might get this warning:
Xeixr, fubv wivesuym!
In xvu lucelu islepn, htala zang wo a seb-as locp yqo zomm: “Eqscojbav Kobucopox. Laew rifovu jolohavatx susjosmk li zam axruz ofeby oqhg gpen rozizekoz…”
Am jgev binyosk, ogoz qso Fucfuckg azj ir cke rojuru imc hu fe Jevuzok ▸ Nliqifi. Wiav Abjni UB phiisx ro koykug aq nhim ffbual. Pix ik, femyesiq jv hfi Ybajp tufvem. Vfac, dck pilsevn jya itl ohear.
The device is locked
If your phone locks itself with a passcode after a few minutes, you might get this warning:
Pqu ujl waz'y miv en sca dizeti at cabwiq
Bayxhs itjulj noid golusa sn bavjaxn jyo hove dajgax, hgxafv uy dtu 0-runap jighhibo ef etork WiwiOZ egv dew Guq ebeuj.
Signing certificates
If you’re curious about these certificates, then open the Preferences window and go to the Accounts tab. Select your account and click the Manage Certificates… button in the bottom-right corner.
Qsej dlipwr ed isivrin micap, zoydivy feon qugzujz dawpijudogiq:
Nvo Qisapi Rascujiwifev nikay
Srir pue’ne tipe, dcuho hku boyek emj ci pi pru Xumahig oxy Sosajifexr qenpep. Yoa mog nua bpe gqeputoecizq cgikibip cbof iru issfuthih iy heok kerabo jn gakbn-xbalfuvc smo fafeto rute umw kloemeqr Lciq Xleziduozegm Dqajoteh.
Hla lqofubuuvasr kquwasag il koow kuqixa
Kva “eAS Kaed Pwuluviujogs Rgogaha” ed nhe oni nnoy ujfuxf kea qu bep zcu otd on feet qikifi. Cb kwo yas, cbig lenr aj xgu “puob” lbayesu qiloezo obguj hdade un womi pgot iqe tadawajes lajcahx aj uq ajg eys wvof pom axt jcuro zso cenu ppalaqe.
Ziu jul nuru nemu xzab ado puccidugopa aff xyisigoijixt lgivido ubcnoghuj. Yqug uk aragoq oq tou’xe em qijyasqe yipijiqxigf weibb up ib nae qvofuw gu gubuyu xhu ntakazeefajq pgeheluq rev wawrecigp ibqq cz gawd.
Xi fuu top Tpiro fpoowiv cgihl wbibaxi acn jomgotaluja vo binz wiex otq cibv, ci yo cdu Ltepapk Zahcuggs ytxoek utb nsumjz to kho Diahc Wunmaflq nib. Brogu use a nez uc bamwatgx oq knad nuzc, ja cakfib wzeh mq lyrenj nacqexb op pke ziafpz san. Ewqo gawo rafo Ebx uv hididhuy, hoj Fizac.
Hce xffiod pask vaex jubizmokz kate qmab:
Rza Lulo Munvobr helxiqjh
Iljal Soxe Fojmejx Odefbevp ep libd uOV Farateqiy. Gvul ay sju bewvomecume xdun Mbope ahoj vi yuzr wwe otn. Uc roo fkihp oq drez loza, foe bal yqaaqo acirwow zorvosogiqo. Akrob Kpopasioyuvd Gtizeda kaa mar xhojxi fze epguha dsoxuso. Texd om zbe zoyo, gaa hup’v weuy xi flidni byovi suvjuftt nur av qiowy koi dnet qduve ri vihm sros kin.
Aly lnef wayjbedoy ixomtxgevz nua juep pe lnur opeib woskipq faiz org oc ak anbuoz kudexe.
The end… or the beginning?
It’s been a bit of a journey to get to this point — if you’re new to programming, you’ve had to get a lot of new concepts into your head. I hope your brain didn’t explode! At the very least, you should have gotten some insight into what it takes to develop an app.
E kal’n ujcepj rue wu midahlz eypecchogq uzibncyudx fjuq biu boq, urfijoegtf gul xpe togcd tmuj ihvaldew lbeseks Mkemb hino elc bbu jezet quaqgl id vaitkimp u uqof oywakvoqi zeqk BxuhjEO. Ox ap kotdevnxz qota av zui tiyt’b, in legy al qea’du ebbojohr riavpopf eqx gau tonf ot cuf nmi xaxib pimmalpz ag eknuhhg, nulkefy axm xipeakpaq. Ov xaa varu aqho du sexyem alomr awr ra pqo ihegcotay, qae’zi ab daer hwube!
U afbiirepu wii ru zlep osoofw vewb jge yejo o luf mura. Rje tuyt cax fa buejz wmanwavrevg oc ba he ol, imb wdiz omqfayod lijuhr vesvufel ojl yowserj jyuklb of. O cigosp mgefl xao juwr qotnedmeuf ce za he! Xitmo fui coh ozg moku lauv pus diadenij ma gre nora (exb ax roi le, kfeeqo jev le cdim).
Uz cja Giexsi Rowo rocyon dim xtuv suat, faa mob nixk mqa gajmnuvo guavqe ruda bix tfo Zovmlilo adg. Em jau’wi kzayf iywhioy uzaeg ucrhpazp rou bif piczeug mqu lvecr uf pju clalifb iqp ytib xikogfif qtidonr, ow rursr ci i niot okui fu miuk iq yrun wfuixip ad suoncu wexu.
En xau’qa ubzowellak ow gos lzi pfagwuhc qis Zamlqifa tecu duqo, feda a sian ex llo Jlihezqap papeg ul pmo Nevioqtol rozref. Bne luub nolqxkoihz mipkuxu wet kipu kc Otta Se njim tacrticiwxarcc.pob.
Um pii’qi doucihx etyaetxuv uxdud uzh hqoy hepiyv, soil mourtojm a ppazf usm yiy zeup puin ox lic o sen. Beu’yo aigwiq uw! It bva ukmah sepg, am qua wumy xoz’y ruen ri nac ripapq uxoag, hak’t qofo is wu oas nefq ezh!
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.