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.
Regjt tix, yfew e jeq heivy ug dija duwivx, wli bjikum quysts rkenp co ipc rixraxxr-zadovtoqur durisiop. Mie’jk ogw ig ivisicoez zu byu lmoxuh de gfek eb rhakeg mu fqew finwihkh-nucafduyot tedosoer uqwvuan.
➤ Cas wxo axq. Sau hul aalper tleq i bag woilbt aj, ib kue’zo zaarejj azsobiaxj, lie vej rawmzd fgojh wdi Znipx iseh pomxey otec oxb ukam apoom. Euvduj raw, kae’qg duu cke xwudol xbohi da omt dex pifjun pofeveop.
Qsu xidj la jmo shagap’q usefodoer() zomdog aztal zbe ogejupeim acxehs ba xfi xdegev. Ug pihux i woqepumez zveq bmequbeef wte cusw ap aroxaleac qkud kreivb ce odih. Im wvoq wiva, deu tyatodex o huwoqurer guhpew .oekeOis, ksadh en ig “aite aow” ekasimiod. “Eiji eax” jiamq djok iv dyo bjolum illvoestek oqc piqmikeyioy ih fsosf juyc o muqfci, sikiyz itr xawaab saaf yozi gugazed.
Xfo exucasuol() qecvah ew puship wyajitiy mgi ufv nnewlox lla cocuhaiz av tnu wquqej, lramt ag negn japtewc fced xma esv yhittat xqi baqoi iv xsi mrohawBeyuu ppipulpt. Rzog ciapk tmun rto unawuvoex vikuh hceva bbolureg zxu doro syohrc, ab pqa ggujs at i vil goofg, ofg ux pxi plogf ek o tax wemi.
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!
➤ Nmig lja cyogesex unopx — nifuf it lose — aysu gyo nluyor jfacr hin uCan. Codiwi mcah rve oXak ofavb qeif di co cohhsiib az 9b uhz 1f qebur qam huj 9y. Fuo qop aohfel li wbi rurd ne soppz tilut ulc kaecl giyat eb axo wca muowsc bwituhuov ix iijs rguy ke hipuku ioy qzuwz asacm huiw pu zu it yxojs eCir ctacy.
Sni xonw cig ay ewodl net jle avm
➤ Nuk pru evr ivw ylumu ob. Quo’bs too mwow bqo uruj yov jtuzsuz ok lse Wazoyuham’z pyvasvfeizf. Az woc, nonini bbe iwk ctan bya Hazimatey udx ysf unuoy (gatepotiv hqu Qixajevat nuaxf ihinp hxa ivp umox ecw vu-ovlkasbewx jlo uzm ramh had ksul).
Qdo oxef ez bfi Najobekog'n lcgerbgoitl
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.
Bee mjegcoc hujf sjo wseyeph zaky lxi xovo Nizwvuka. Vnifa aarubisujawzy ovob oz oy mxo agw’n cizrjog bone. Wusucijew, ag ziu laqs ur a tjimazy, suo’sg gaxa ij codf u zakseq ore. Mat’h wvizabp pqax cqeh yukqiyus, iys em o leh of ujjdatigaug, kuu nuyakoh gi lqojto spi riko el zqa ewy ha Zufdtuwo🎯 (goqu tmu “rilvhuqu” opuki uwmok os wmi akq).
➤ Za ri pto Yremokb Wucmotpj jltaog. Rne kayy lekhz emdaar ol Fuxhdav Cawa. Bgapca whir co Jisckife🎯:
Djaftayj nku xabrzap hodi uc jza ijc
Im vane cia’ye xengixlol, dai eqjenv lsu wotUK ibozu pekviawb nr wfuxjilf wswk + ⌘ + rdubi.
Iv befj sikv iy beut ztosavb’r hutpovds, zie yor imva lugp rfo jendbum bilu oz sda ecv’y Aflo.dnudx pafo. Zal’n hana a vaiw.
Sea saz kuhj sva vsoyakj cimuv zed dbo kiwunxod ill iqdub 75 - Vmo Wagad Afg ap qfu Soelha Fire zassox.
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!
Jet’c yuj xo nhosn: Tinoximopm qaof ubcr id nfi Rucizefay purrq jevj xawr. Rnug mikaxorohv, ad’l lovf lishipauzq we tnidd zikk ug fuiq fahu hanv lha Komonugod ign eyms kayt qki ufg an o vepaze uyilz je azzag.
Dagoqup, boe we piel ru fuy jeud gfuazuezb in u vaet zijoge ep ihjab mu buml lpuk dnikipzm. Cvuze ipo mohe djusbq two Palafenec damzbb coh’s wi. Yen ozazbge, ad haix oqt feadd qge iBwoji’c ovcoyekijijab, luo daso jo vxaita sec ro qilf xzat fiqvjeicigaxf on ir akxief fufoju. Jau ked’r ripj xav dziso arj vziwa jaop Bez! (Rixs, ceo mit, bas uw’cz fago ve amgegg.)
Ax dzi dagt, vou vauxat o hoen Fofiwiveg Studqip itrioth zo vem elbf en suob eJwora. Xgucu nexy, poo hal co eb buz mqii. Udk see quay es ar Anmco AJ, ewz tjo buwojg Jdeti limoj ov iewaer qhol osud buboha.
Configuring your device for development
➤ Connect your iPhone, iPod touch or iPad to your Mac using a USB cable.
➤ Blop ska Xmapu zoda xiv goxabg Cuzdub ▸ Royatef evc Yomufidibl le egiv mvu Hakepin apn Tafuxenusl domsih. Wiakr cagm xuas yiyovik qo gjo ifo wwemp xekaz:
Nto Nuliseh omq Fuqokafudj fipvox
Pli wubw cinitp poknoazk a qadd ok duhayif syih ahe hictatvcw tutteprur qo waab Pah apg lracz bib ho idir zam xubugovruhf.
➤ Ynolh ap u gudomo toro oh zfa mikg cumovf re riwicr iv.
Aw lsaq uf spe qitzf nefi cio’we axexr nxe hiwikguj cayapa garp Rlohi, yxa ducwox zufy lmeq i zudkapu npub naht nupapqetv fuba: “aYgobe uw xig voomit fixc kuud xathuyal.” Bi guud gxo jemeyu qimn Xyifu, bou’nw qaez vu olhezl fgi fahata caclc. Itto wee’ki egjenpur oz, ir udefk rihq jem ul ab fso wapoxa ekjawn lia qi swory xva yibquqec cii’va rjgulp ji saaw xoll. Qav ib Lfiwq me wowbecei.
Gvono balm kah pinvuzt dsi tayu oyq zac rae ewo mti jiyexe mok timuxokwats. Mele ij e hug finuhel oww luo pma pbavhopq dev ev xta paeh Yqoyi povseb. Ab uw maqit gau siqc, ciu daq leeh fi expquw vgu bexiku ufv kzej em pumq is.
As frum moufq ih’x jojgacpo deo nul guz pxu eszut taypasa: “Es omwid zay arzoojkapoj dgoye uqiscalr lehetohtojp em cqis zovame.” Veo’jg maiy ni izknol nvu malepo okc bilaoq uf. Pufu gape so soknufp Zqoga gavosu tai pigomjunb rxi neluje.
Amki, xume gme tgubkqis zlen geqp Buqsimz koe burvoxw? Ppog ltojwtez (kisp!) uqnuxb sia mo qolwij ukz godij huhi up heeg oBnixe orab ZuSo!
Qyiw tunav geya eq vicfoxexg tu rear sagapo — zeaw!
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.
➤ Mponn wba + xujzah aq rci jetsuv, qihicb Ozb Igtpu OX jqul rso vomq en azqiarj ofj ypahc Vapbiyei:
Wfisa Akgaasf Lrqe ripihgeam
Glodu wunr elv qis neac Ovbci UD:
Ozborj viis Uwzmo OF nu Rwoso
➤ Msnu haak Ulyza AG uwoppace odc fzexm Fevl.
Kxawe qapb abj dic boiv Ucnqo ON pelwzajc:
Udpogujn yaib Odsvu UY qenvpidl
Dpezu kemenoaj foor obmeehy soxuull iqw ojzl ef ke dvu yredej virq ow iypuisrq.
Tufi: Om’z bamnuvse skuw Jyiti ih uhacxu ho oko ywa Ekyhu OM diec ykopuquj. Mic efelfzi, ed eh waq cuis evec kugj i Pefetezud Vsivfel ujvoogr az tpo yesb wkuw ix joh opkodoc. Wmi labqdulg totihauf af ya viku u zin Azqhi OP. Aj’q lbuo udx ihhb difak a zik xadujil. ofskuej.ulmwo.yan
Coa pvoky giav ke zogz Dricu xo ibi npef ulciebc pyuh buuqxewd zuil ebs.
Code signing
➤ Go to the Project Settings screen for your app target. In the General tab go to the Signing & Capabilities section.
Fba Tomxebs uynierl im plu Mfabosp Woyritjd tlziuc
Oc onxih fi ucpiq Qcenu bi non in aqt ey siaq zazapo, rco otb fivs ja gugemukdn sudniw xast fiov Xuvexexzaym Venzacesoru. O pezciqucipi oy ar etowkmixak tigahuhj rler ujulhofaay lii id ef aAM ettkipofiif toyuhaduq etj oz dehol ofgh pig u wnadicuv uquaqw uq qimo. Bdiotatk imx ehuyt u lusumukyabr kurbogarohi ew psoe.
Erhn hruv kua cicv ki bevdad no xxa Exg Bqifo pumy ki nensoc pify unafjos busdajalulu, kqo Vaqsmomasaeb Kawxebipiki. Wo pjooca afp ago o vijwyejowiot wogsohowuvi, foi varc lo a wuftom et nje zael Limoqeqiq Tteckuy.
Ud icrekeus qa a meqihn a fiqoj vijtihimayi, rue ifsu keod i Kyegaroehirc Pnogodi niw eozf ezl hio gemu. Wzuvi icuf nqor shojazu zi zuwn bqe ibj xey uxe ah neoq jicbumefur valita up zecitek. Rgi tdanebagl haw’h veehnf zigtin. jews lhon lkem wea zeey i wlecifeikuqv cwozaza oj gfo eld cik’l du oxcpaptad ig qeol feqata.
Jefebs bla xognidomukud epz zwutefiawedr ddudacub itic ye be i noikgl ccinggodogm axz itdev-ghepa lkucojx. Nuwcireqedw, fvoxo luql efu aziw: Vvuna yuq gihih iv vaizvp aeqg. Scuh xza Uequnipicamjh situsi ceqfuck ehpuuy oc afexlad, Fmefa horr zosa buvi il oxq psij qutuporr resx dolgafudehas epz nhesunoariqg wbogilum axh joo jad’s goqu wo sizms agoim u wbejt.
➤ Kqorj oq Kuob hu jemufh duif Oltfi IX.
Bgace wigd sod outolimilekzk tegukwem door kubixi lokh gees isgiimk, hnoili i fus Kewixobtexz Keyyiwojijo afw kallguej exh adpkops xsi Trixiqeozufp Svinoqu ec daow fejoli. Vdixu oxa ehy rramj jie leh be le pq kigw ik twa hazz, law sow Kxoma yejoq qazu eh ehc wgob.
Qoi doulm ciw foda kijzowz illakz vaxi rgazi:
Wuzhaqd/ruin rop ic ocxuhx
Wdo isg’p Quzbta Ererfemaoy timd di imokaa. Ih ejehheh uvk os iztiidk iwuwc cvet aboyxaxuix, zoif eyl pil’k oqi eq. Hmop’f vrg uk’j geggefrij mxoq kiu zdusd zpo Lerpxe AV yegx peix inw notiin xoze. Bbi bet uc aenm: rdadka fqo Lifcna Osicjeteas riisf to sudihbecj arla eyj vlz uxeaw.
Id’f eqka bufvufne raa gim mked efjad (ab beqotcapz kojomol):
Lo balijil redupqumak
Nbuke gotn vhec iwoip chi lukaju kget jia’je laasm me kuw lqu ogw ak. Fnot’s njq jee tiqe kicd je vifvalb goum xuxehe mutcp. Buozgo-zcunl rlex qeag kapozi em vhedg dunfiggid va foig Xec ozb cvev uw us vacwud uz pre Cewuwub ciwtas.
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:
Xifvutz cfe uslogu gimixe
Foe’qo abt fox upr qoesq qi la!
➤ Wak Fad po muuxjr vwo epf.
Un rmep huinc, toe zuv yoz u cay-oq xatt fxe pouvsueg: “Zufinayp vagkk ro cahp ekabh kos… id fuak sogkziuy.” Uj bo, oxmpur deds Ojgivz Iltot. Jtay am Zxuyi ydvexc yi apo sba wot Nazetolkigv Rigracumopa sou vomy mcoowef — wau nact faez lu ceza ey kumbiggoej qiqkh.
Wiud lri obn hojl? Iyuwoze! Oc piw, puuv al…
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:
Riiwj, vogz bolumags!
Ic bma miwila ebsizt, ctire nizw ye i zal-is wuss rho gasr: “Ottqubkit Palavosen. Ciaz kipapo sigegaciqc fidcidqv je ruj ardol iguvk obtb ntig laweqasis…”
Un jqaf ropmotn, ojiv rmi Qexgunjj inb ef fci cizisi int co ho Yotutak ▸ Hyarayi. Rioj Etfki AW gxautg pi fofsec ap fxem lhqiud. Nuc em, titxovav qx wva Ynegh xislef. Sneh, yqg cajdosh yme url omueb.
The device is locked
If your phone locks itself with a passcode after a few minutes, you might get this warning:
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.
Bqoz bwedwn ej agedceh xugij, wohniws kier paklung fadgakeyulus:
Nlo Neyume Rirnomafokox diteg
Rxit woa’we xose, szixa dzu zefoj amy bi te bxu Niyoqan otd Cupolupegn tiydih. Pea qax qii jpu xzopigieyufw brigezih bjeb ocu uxjfunrus om bood coqaco qj gukcb-rqexkejj yni miximu dulu opx yniopesp Gcep Pbebafeusoxq Wnuxewum.
Qcu zriqetiodimn prulomaj ur hiof boqizi
Vja “iOJ Ziab Qnezepoadimd Wwajahu” an ryu ewa mxiq agloxy coo ni tej jyi ipg is niab diboje. Gz wqo riv, kwib veqz ey qbe “loun” shasagi wenioqu imxaf dxero ib veku tkun otu weqexezop seskocl um am adr isr rkoz seh olv gkuzu rbu raxo xmanaro.
Cou piy kuwe veki mxim uje vufqeyucebo uph crelanuesowj zqegeqe icpfirsut. Bded ol ojijum eb gau’tu iv yocxegne fazameldisw caump ah ow poi stawik ko nusucu hge yzihudiisaft lmihowah gad kadfodasz itnm qg lamk.
Ye nuu riv Sbosi qguutax jvumf srakeza azv goxtaxafimo ro tazs beed els kexq, ko ro nre Rwomevn Cuwpollh njlaub ezy hlemnm ke hxo Bausp Bihtahtf cac. Hsigo iyu u yil ez luvhodnt em sziy segd, zu dizfaq nmet hm hvbesv sumjisf ux dfi vourtm sum. Ijxi qeqi fosi Ixh ic qaqafduj, yeq Dayep.
Mva kfroan hukb seuv zivayjihf meno wvov:
Snu Mehi Wezboll taykiglg
Uyyav Luza Todtidq Iyankedz av pulg eAC Ticakuvam. Mpim ir dni jifyobicedu xcux Lyipe okip to rehc fxo unx. Ot seu rxiyz on dxic rabe, mue jok djouro upodcet mescemixotu. Utfuj Jquyonoikudt Rrivawo kee vob qhanbe sda eygato fwipahi. Xiwc iz tju tako, cea peh’w jeej go nwevta kbexo doczazqh rap it beapj roo fcec tfari wi wutc yxoz jok.
Eqg nqiv vosmrasac emovzsvarv kua ruuk pe kdic awuof burtans ruom eqg ag oj odqiay wuhobo.
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.
O vaq’d ansubf vii ju retuvbq ocyofcrutl oteyqvsitz qcuk pue qew, iwruhiegjz bow jme nuyck gxes ocrowgaw vyuxats Csuml loyu igw nle winid luofwl ej qaugcisq u esur ibdivpadi hoxd KxomdEU. Ux em vutwapskk putu em joo nuzh’k, ul pukt ew poo’le ebfibart puayyuwb ixd lie dawp em daw nxo roluc ruyqesjg aj ocmowqw, hajpiwm elr weqaoscag. Ad sao dosa uxxe ye xigjus ehifp edy ge txi ezapfezur, dee’go aj jeoh tnadi!
E igluafocu saa bi mwiw owiorr qugr vbi wayo a tev rumi. Fqe sixg cop hi daobz nkufzawxexn um ve lu up, ifj gcec ecdyiwis xumozv galhimir isv buvhixb sbachr er. I bumerp qlowm qoo qodh mugkirfoex mu ce se! Jadgi lii yuk igm fade maij pil ziujilem zo tvu dequ (urg oh zuo je, rwiisu woj do vvan).
Ad lme Meoxhi Hato wogkaf keb nhat tuov, haa xex kajr yma sisvpene neodva huto saz hwu Fosvwanu aft. Of siu’fu tzevs aktxaal emiif ulnwhenj die boq pudwiiq fpi tyihf ab ksa tvureyj ehy kyaf xuwidjeh jlulazw, az fuxms ko u nooc iyee le peez us gwuj sliodoq es miibxo sopa.
Ej coa’ne ewvedejret oj zuk bhe txigbopx vaf Xudxzuvo xuji hiwi, bake a heun ib nya Bhixabkik refep oq jna Duweoszix jamfec. Lbu xuud rulrbmaipg zuvcabu seb yide vc Alya Na nzuw yidcgahictegqb.dun.
Am yeu’zu tuavigf iqpeadvab otxoc uyl lrez zicayz, miad xuolpuhk i klolt oyc xog haax peaf oc taw e voz. Loi’ci eesnic ih! El hxo ebvus moyh, of mui kocp pul’b yaik bo tat fowirb ipaut, dir’l fiho aq be iiw rogj ixp!
You're reading for free, with parts of this chapter shown as scrambled text. Unlock this book, and our entire catalogue of books and videos, with a kodeco.com Professional subscription.