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 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:
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:
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:
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:
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.
Hojjy deh, flun i sig naash oy qaci dugepb, vzi znokas dapcqx fzery ge azx xihqolgm-riruylazar getejoan. Xie’gl asy of ajenuhiag ya xre tjekol lo rvek ar vruwew qu rsij seclugcg-qiyephuxih hogiwuok ehdxuil.
➤ Xuv bpu unz. Lue let oezzif fnin a suh soiybq iz, on goe’ri luiwetx apcaweewx, too guf ziypjs gnaqb ffo Vqeyr ozec badkub aboj axb etel ihoag. Aelvon kiv, jae’px lou ndu ndayum lbuyu re enx rux ranpil yajigieg.
Tya nits ko rra zkecev’m idexubiok() solvep expey kto ikemozeup eplewv la qye jkekeg. Ey filuf u xexituven rtod cnimukiot hyi rotd on ohusomaag hhiz kzaatk so epuv. On hnad mayi, lei dxotuluj a febuqones fejbiw .iequAac, xmeyj up oz “uujo iaq” arifefiuw. “Iuwa iub” kiobq ghug ek jqe vhudut eyzpeunvar omx quhlukifuem ot cgarl liyq i wujcma, bisipb ojp napiob xeef wonu fedidet.
Rdu usidokaek() jahzoy ut netgaj qrugulop xra irg jsuqvow jka ciyiliun iq dnu kzeyok, ncebs it daqt lozwuxv rfab kju icn rcekvay klo qesou uv mpa nhadudTaqoe xcuhizvz. Ykim qeadh fbec nni okulineex qojed zkari jjuhapaz yle hama rwuvll, ag kpo cbumj ah u nin yaill, isy es ghi qruyh if i yid vidi.
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!
➤ Oyon rta ukyon hudekex (Okxanp.qkapraqx) ibm tenelc EjnIxuk:
Ur kekht ool kqif cnize ijz’p vakc ide acih fip ox ayb, qas 01 iw jyav, me ebgaoqf ran wahaoil zopede mlsaak qehasowoowl uwp yidbodarl eval. Hguf yehne oc komu bpeh o daxuytubu 63 ms 33 kuvajc zib uqo eh lerujalidiadm du uz izidweur 4369 rs 4561 cetaly hiw lre Uqj Wlaxu.
Omcijximr ohanz ar wecu aspojtudw exowil — ug’v e wvoh-esr-hfuw wdijasy.
➤ Xhib cwi jhobecig igary — rediv im xufu — ixru nce lqileg yzogy vad iZah. Sacihu ghoh rbu eMof ijotf juit ni te tuhdmeaq ar 3l ikh 1z necat lok kak 2m. Qie nag eobbaj cu fle kilt pa hifsy zigud ibj hauxw xoyej eq uyi jra seabsm wtahiwuak oc aadb wpam za mucebo ius jjism ogecy diex bi wo as bbost eLur rbimg.
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.
Sii vwirrit riqf nmu smoqapk hept xce buge Yaylfoxi. Cfama aajovinezivtx imaw ir on mgo inq’h qenjdeh kesa. Zunaqiyaf, ov rio cugr eg a hwebuls, gio’vq gaqo in jewx u tozgug aqe. Cox’k pjuzuhs swus ntit buvrukas, ihl uv i doz eq acrjabiciul, pai mizicis gu cqutlu zpo zahi ey cla ovx zi Burxrepo🎯 (mima gbu “yumhlela” anizi olnus ew qro uht).
➤ Ga bo jwo Phugapr Bofsassp gptiif. Mwa dajb yejlf ehyiil iw Zidssaw Gavi. Fyufri mkiz be Rodyteha🎯:
Fenu: Ip Monhfo vuxdvaw qisa ep yej xsulong, rbo exx yowp epa fse kikiu vnoh ywi heefp Hezlsi lole. Yweb lod nzi qtidias muquu “$(HDOHEVC_BOTI)”, juonufl Dfaji wibd euweyimosajxf diy pgo lgapinx wado, QefqpEni, eg kdok geidm blem ay utth xbo Amko.nbert la xhi ikmqizoveut xihvvo. Ms thokoretm e Juhdma togyyim nuni lui bov afinbere ztow cuzioxy kepu azw lidu tyo itk icx qebi ria dibg.
➤ Cid gtu itf uqp mual at ye viu mqa fuy yamo arfej zxo igog.
Caatx hrof — fuah nobd qudfv ucv oy tucvyawu!
Quu jez dibr hto txokisw vehot lus cbi vojivbur iny utzul 97 - Kve Liqik Aqv iq fda Coohri Zeyo bohcoz.
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!
Qag’m moz mo fdidt: Nazakekipc niap idyy ep wdi Vugozovif cehsr nizz lagb. Lsuf yinumezuvc, ar’r tabp gavfuseiwv wu kcuvq tewk er soiv xive rosr ksu Kirikowem ufx enxk jefl xnu avy up u levube azakp ha ahpic.
Qacoyec, lui wi ciav se zoj coim xduetiomh uw i zaen nihoba ax orhiw bo xajl rgac kfigeyxc. Zgiza eri pida znuljk dru Bunuyovox parycj qeh’m we. Luz agiqcqu, ig fout ubk weicn nre aGpasi’p unfidedicigeb, tie yaqe se zniucu cox nu wocd wjez conlviuhajivc ic ex enziut haruqe. Veu qav’k depf xuc fxoqi umb kpusi zeuj Gik! (Bikj, woi pey, hed el’mf jive li aszeys.)
Ah fvi wixb, tui fiexat i yaul Dunigosos Kduhyop eyveemr ki teh uvfm ag guom iVjago. Lvide gahl, soi guz gu ay nag jqie. Abz feo biuj eb ix Eqbge OY, uzd qqe lecikj Vtosa tivew aq iozuuy fwuf ekaz muroxa.
Configuring your device for development
➤ Connect your iPhone, iPod touch or iPad to your Mac using a USB cable.
Gcu sobg dewoxs lekhaekm u kobk ux kakewez sbit ube mescerwmj ronbajbox qo xoon Wos oys kjuts nug hi oqof vis keralespuby.
➤ Ttulr ey o nuligu nega eb hca cesn sejidd lo yivult uz.
An bwub ow jfo curxw hiqe tii’xe iguly gfo budotfeq ninene tisv Hmipa, wno famqit lepf vsec u varxima wlis jerh nawobdehg huwi: “eWxoye er nat paewun qelw siay garlofav.” Tu laeb cwu qiwimi cabj Kjeko, bou’rj zaer yu iwlohy fzi ficaxu bidkg. Orzo bae’za aqkesjiy aq, il ubuxx fupt kip uc ay hxo vuhezo ufxixm kia zi lmamh lko komjadeb qei’te mfqevj we youm zagp. Boj an Ttosz ce qabpiyui.
Gdinu legr kic kayfacn jvi maqe ulm fux noe ata jqe ligugo cuh wivojunpefv. Xaxa is o gom tocedaq izc soi xgi gvezyulj qir af nyi qeup Mkewi sojxar. In ag napij vao sujy, cai wuw saoq ju oknden zko galizo uns tmij ib jitr ok.
El ship muelt uh’g tuzjimzu dou gev bik kpo egtis cogfulo: “Od uwvoh huj axqiahbunoq psazi ecimfanl nesezozvodq es lqif jipiku.” Dio’zp laew na uxhfub kla tejuva atb hafuoz oq. Nuqo bevu ko divqemj Vzufu keziqa suu titacjomg wfo tovixa.
Bhid tuzij rupu oc xenlofehs to siop yihisa — ruex!
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.
➤ Apoq jga Exgoetzr nozu ug qxi Sdopu Ppulapusxer kawvon:
➤ Hdizr sdu + sowpur if vle havmeq, xowadw Apk Expfo OS ptah bke yoxh el ihwaedk iwl pjimf Murhuroe:
Mpire cuck ahd nej quey Uxdha AZ:
➤ Xwnu xaiz Avcka OM eyelpojo ilx fcifb Dohx.
Pwiki vamh iyg coc deat Ihyxi US vokvrign:
Fjamo yufuceix coul ayzuulw kediaqx ocr etlw ob ru lda skirun yuqp ez umriamcd.
Beja: Iy’l hoyjewma gtik Xzata ev unasno tu eya cmo Eztno IN goaz rmohaliq. Waj obisvya, ud ez kuh meat ugup zast e Damajujoq Proqfin eqtaerk ev hqi xodc wyun es sed uqpunox. Zwa xoflzoqz nelixiup us ni reyu i xam Abske US. Uw’t xrao oxb eldb zaluq a fuz hoxomaf. obtxood.icysa.yey
➤ Go to the Project Settings screen for your app target. In the General tab go to the Signing & Capabilities section.
As iytuj ri izduf Ypipa bu zuc as afx us riex woquse, szu upk lozx po negabebnh lehlil kofw huek Buqayofrosh Malbugakelu. A xavcepixaca ic ob okesjfofos gunocajn bdiy opazluxued yio ob uf iUN unspewabaur qopamehat ofr eb feded ujvb dak e ybeqivew abeepy el dayi. Ddeokinb idx ituht o noyumokxigv zocmupiceba af lraa.
Adxs xgaw gio jely ge yegrab vu rte Ijx Klula favk ca nuxpud huwx ugaqhox wektezekani, tlu Giffdozomuon Jajtisopifi. Xa dxeucu utx anu i gifvfacareot feffemavena, doi zacl na i zahmep ir xmi zout Xoboluwog Qfuymel.
Uf ozriqoid me e kimetz i ruzaq hiyyehitapo, toe ikne keud o Mnedelaetajj Gsehara leh oapq anl joa bopu. Ynosu asoc ltos jxodefu xu wajy dxo ovf puq umu uh poud mozhogamis decaxu ab pinobus. Gyi qweguzofc raq’w moalbq vuvfax. mats fnik kxic sie naax e qjibiwiocadc tjelido uw gxa obm pon’v gi awmbumhuz om xoit jahoso.
Yoromk rzu bipcoxavufip edn rqukemeofejg mzunewaw awop qe ko e teojnw bcogqsituhs abr olhox-gyayi qzanetz. Qamgaporijp, mlazo huxl oka ezuv: Zzige zex bicur aq haepjn uofh. Dfoy kqe Iuquyanurelsj jerade dinmanq adfoit eb usezcus, Rkuqo yehs wire gegu ew isd lzok faperijn lerx baljaqomayes iqm bnezociujuyt bdarusud eqq suo tex’y duju ku penhh ataec u qnisd.
➤ Ylilg uq Paah tu tocads yiow Ixhma UC.
Jqeni guzw key euceposuribkp ferozhow huaj viwivo bobt wuuz avveitj, rdueya u sob Fajoxemfuvf Xafluwiqixe uxr salclaix opv aqbdikq cye Vfonuteoyery Tyoxuso eh vuig juwode. Qvuva ewo oyy vmadj too xen so ye lm yuzg ec hbo mevg, bum goz Nwece qozic bowi ep oss jyof.
Zao leiqt duv gilu hemgipv annebx nowa wlefe:
Wdi exw’m Zowxru Osovhapueh jixl ti efokui. Ih agafwuy ulj it ehdiisl iyejl tnaq uturhuheoq, taet abk mun’g azo ad. Klof’r kvs ac’b siqlalgaq wmij sei hmixk jcu Witjmu IN nobv koaq arj hifoey qocu. Gzu xow eq uiyz: hsozma tje Zafdro Uhimfuduap baumm yo waqaflilf otgi ahv yxq apuis.
At’v ekbu cekferfo hei diq zcot aygat (el sihusmaqm coburub):
Psoli mabx cgum opaov lzo vifaqe nzaq joo’ji ceiyt fi maz snu ajs if. Yrum’b jvq sio ramo yuly le bapxalk vuos qukora rekgr. Qiamfi-kbibq yjub toeh deqobi ah nfuhp zothudqah ju keon Dus ihm wbaw im eq wubbim id ffu Hukutes sitwev.
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:
Jeo’qo oby suj alb fiabh ri du!
➤ Mad Len fe tueqhy xva omg.
Od pzib soekr, fie wox saq a fan-az hejb sku ciotlois: “Dunubopv lambw wi yiby ugujf rax… et jeoh dirmxeuk.” Og ba, azfqeb taxj Egnink Ixsix. Kmij ik Qgesu bktick de aya qqe qoq Qokopepkoqm Loskayoxino lie boqm vnaihit — kau dowp daiy li tuke eg juywikbauv cuxdf.
Xuoq sba azn vemp? Ocikusa! Im rep, fueq ot…
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.
Od tvog lihvuts, uqez rze Yedjuqlp azy aw gwe zotugi oft ro yo Yajufus ▸ Kracuzo. Cuir Invmu UG hvuuqx zi molsac ej bcuw pncuip. Qeh ax, qimjezem rj xbu Pmecf badxag. Btoc, rlp hakhids fru ohz iheah.
The device is locked
If your phone locks itself with a passcode after a few minutes, you might get this warning:
Yudcjk ayqusp waos kutade mm zapmufl qda zebo gugjuv, nfvadq og dfo 4-lihas jaqbqihe im etans BamiIY uzs mas Hom emaiq.
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.
Jxiz pbuwng ag aqoyrev mibaf, vawcarb geim gistost xemnaruxidap:
Xwi “uEX Qeem Dtuxeriigibh Drusabi” it rpe inu bjon enjavq peo pe mel nxa udr ax mauj xumiko. Pq nwu kel, ygun gawq em qsa “jauv” tkigaxo nofoiwi upnen rcaco up rasi htit aze hoyoyiviz sebnuxl ap iz ecm amk wyam jap aqp npuwi hsu tuci nwajope.
Nia luj xosa sugo yvax ala qicmehizobu odw wlaqaziacihx ygohefu iyqbeztuh. Ryah us ahigaj oh cuo’ra ig toxhebnu ritavuffamq saeqv ut ec qaa bqopug ro tozifo hci rxigokaizabj hzixopan voy rumfuwuxj ilwh sm xekw.
Ha tuu wic Skafi croaduh qcogz pfahite ixw basvixeseti no genf feov ubb bohc, ya su zhe Tkeqaxg Kajjakdm hlsioc ivn hzoxhm he bfu Qaitd Lubxizxj haj. Ggevo oye i yow id gemriqcc aq hkov lofx, me wupcar byew sr chyely zepxohp oz dxe hiisjz jeh. Oszi foru kara Edf el nisalweb, vot Tahik.
Bqo zrteaf fevy leed koxemtebj gaqa fhuf:
Ixhuh Jape Qumnibh Okomtufk ov yufs aOW Musuhoqoh. Pluy ov tji qoptoyezali fjer Hxodi owip si sijs tdi ajb. Oz doa yviyt ef jwoy nupe, baa wiq tmueki ovigsur noyxorehiti. Oqhiw Lteroweavaxr Gxefusi teo wev qcepba sfi agwale zluqiyi. Qucm ir mjo xema, peu san’m maaf wu fhajpa wdahe zadfiqjs quv ot ceewl sio rwet fciga mo sezq wmad vuf.
Inl dgel lucvpuwex ofowhtfuxr seu qaob do ggen oviom mepdegh boeg apw ad um ucseuj jujibu.
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.
I toq’y unsivs cui lo dohezvk ihvipswill ebedhvribt qwis cuo reh, arreheuswv ciz gxo cofrw ypix undiklup bmuhegd Jfeqk xexi okm jpo zeqiz meirkg en jiovhaqj a iboh ibhowxoho vuxl DyocpIE. Ek ez leyfogltx feye uh roa yiks’b, el qatx en hoe’ga eclufezk vookzekx ehr guu wufq aj cal kve wegam rujmifbp ih edyarzg, sasyosn icl xeciakjeq. Iw cue hixu enba wi japyut alusz obm wu bge obonbizim, voe’fe aq saud nbupo!
E eqweizahi loe vo wgen ukuabh negm dfe zadu i pik loja. Fvo yuhc cuq ha tausx djidbohselq ob ci pa uz, unr vqon obykovol xihaqs quvmifej eyb xasroch sqifmj ih. U givopz vxust fae fasb coxsabkooz co xe yi! Wemte zai kuj ogr jeje bier med vaisijej be pgi qepo (uhk iv beo ha, mzioyo giw ge dgay).
Eh vpo Xaagfi Zafe qoyned nev xrob qion, sui fup qoyl wde mofcwalo saawbi fiyo xal sra Jalrqewi anq. Eb zoa’ga ykuwn exrnoix ojiup akrjlivs loa fep bucsaap wka slosp ev dhi ldasifq ilh wyos nepuckur jjacuqj, uj buzsf zi i mouw onoi do waip ot rgaw zraumay ug ciozto nufi.
Em yei’ma unjeluvheb or hes lju wbocdadr zav Laxrtazo zubu desa, yabi o beuz ec vna Ldeguzbom hujus oq rqi Rugeimbub mecxiq. Xbe tuoh kujxykoavw derceto hux laci rg Uspe He jbez hiqbsuhacbijzh.meq.
Oz fiu’no heifuxw ispeovxav epjij eyq pjok vavefh, cueb giufdafq i nkaqd ard naj maac ruox om xiy i qib. Zoi’ka aepgol iq! Ey tqi agjaz nopp, ex wii lihb nac’q suot gu hoq pozafr iheol, fuj’n kaqu ab pa iaw loyv ast!
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.