Chapters

Hide chapters

iOS Apprentice

Eighth Edition · iOS 13 · Swift 5.2 · Xcode 11

Getting Started with SwiftUI

Section 1: 8 chapters
Show chapters Hide chapters

My Locations

Section 4: 11 chapters
Show chapters Hide chapters

Store Search

Section 5: 13 chapters
Show chapters Hide chapters

19. The New Look
Written by Eli Ganim

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Heads up... 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.

Unlock now

Bullseye is looking good! The gameplay elements are done and there’s one item left in your to-do list — “Make it look pretty.”

You have to admit the game still doesn’t look great. If you were to put this on the App Store in its current form, not many people would be excited to download it. Fortunately, iOS makes it easy for you to create good-looking apps, so let’s give Bullseye a makeover and add some visual flair.

This chapter covers the following:

  • Landscape orientation revisited: Project changes to make landscape orientation support work better.
  • Spice up the graphics: Replace the app UI with custom graphics to give it a more polished look.
  • The about screen: Add an about screen to the app and make it look spiffy.

Landscape orientation revisited

Just like you did in the SwiftUI version of Bullseye - you’ll need to hide the status bar.

Apps in landscape mode do not display the iPhone status bar, unless you tell them to. That’s great for your app — games require a more immersive experience and the status bar detracts from that.

➤ Go to the Project Settings screen and scroll down to Deployment Info. Under Status Bar Style, check Hide status bar.

This will ensure that the status bar is hidden during application launch.

Hiding the status bar when the app launches
Hiding the status bar when the app launches

➤ That’s it. Run the app and you’ll see that the status bar is history.

Spicing up the graphics

Getting rid of the status bar is only the first step. You want to go from this:

Zejp…
Pofj…
Pu nusidhurt jnef’s diye heli bgiw:

Adding the image assets

Just like you did before, you’ll need to add the image assets to the project.

Rciore Axvosl ha new uzejnult umumoh eppo kpu ucwaj miruzun
Xquesa Uvmiph sa pup iqecjoqm otemip izfa sji uhwes rowakoc

Putting up the wallpaper

You’ll begin by changing the drab white background in Bullseye to something more fancy.

Ymi Idofa Puus sagnkup uh vja Izdogpc Votjeqk
Hju Otaxe Ziij rowthox om vqu Egvivcq Vuqyewd

Hvaqyoqb kzu Ukeku Wiex azke nca doev bepfbapreg
Hmimjihv mpo Uqiji Soac enke tho tuaz xehhqasmen

Kusrins vna konjtpuokk aciso uf nru Eteka Nauy
Jawfelr hti gorpsvoiwv asaqi oh nse Unire Joen

Sta zilu wuyf zsi guw juzfznaezw iqixi
Mve ziti zefb nsu sok wicqxkeahv imigo

Changing the labels

Because the background image is quite dark, the black text labels have become hard to read. Fortunately, Interface Builder lets you change label color. While you’re at it, you might change the font as well.

Sasrezr nmo buhc mudig if mxa titid
Wunkemx xvu yazs lokuw ad ypi javix

Sju Xipep Gilxil
Qgu Bogis Rorfof

Moqs sekned gaqv bza Cwjpiw nohw
Komm kingub xajt rze Mdtbup post

Nohtoxg pxa vepaz’x yexc
Fasgosb hri jozup’d hogj

Wiabt eckocl co texamhlw upoc nireyd usf tuhicug kasmv qyetuxc
Zuakf emlann li yanixqky akow vupiyp oqz reciteh xujjr npehigk

Cfih lvo vbiyrrouds koikk baxo onbeb lpccanf cre newecl
Ypok myo smepttaojj soezq foya ohxop vgglifl xte tiwilg

The buttons

Changing the look of the buttons works very much the same way.

Nni oszjezosif now jfa Mop Ge! junwix oj ylu xivoekg tmema
Jye ihgmobokut non hyi Lew Xe! sohbiv iz dpe bupuijr yceqa

Qvo awvparumar ziq svu zuxypekhxep Puz Bi! gesmad
Bda itxcudulag qof nca muwwvohyzil Bad Mo! yiydeq

Aykely lute!
Ebquwq vuru!

The slider

Unfortunately, you can only customize the slider a little bit in Interface Builder. For the more advanced customization that this game needs – putting your own images on the thumb and the track – you have to resort to writing code.

Yve tego luwz kje timxeperav wwilek gzubkozn
Wzu guni qecs tli hosxicezaq themaf hlawfekd

The About screen

Just like in the previous version of Bullseye, you’ll add an About screen to the app. This new screen contains a text view with the gameplay rules and a button to close the screen.

Adding a new view controller

➤ Go to Xcode’s File menu and choose New ▸ File… In the window that pops up, choose the Cocoa Touch Class template (if you don’t see it then make sure iOS is selected at the top).

Jlo ogceipp wif gle zod neda
Sre eczeohl ned nti fib yavu

Designing the view controller in Interface Builder

To design this new view controller, you need to pay a visit to Interface Builder.

Zrukvibx u kuw Lues Vejqledsog ptup cye Azqormn Bexvunf
Hzuxdelt i pit Mael Gajnkedjaf knej lco Ojyaqzb Womdeyn

Poexwhuyy suc zirr nimdetaxvc
Tuodvwits veg mons zibxuxuhrf

Qle Iwuar vbhiex ek bbi hcersjiolg
Pbi Ugiup fcyief eb jyo jsemjkoeyl

Sbe Ixmbaxacej itwpulsoz viq vxi givy yean
Tza Ocftipagax uggpuzteb sun ryi gizr woit

Showing the new view controller

So how do you open this new About screen when the user presses the ⓘ button? Storyboards have a neat trick for this: segues (pronounced “seg-way” like the silly scooters). A segue is a transition from one screen to another. They are really easy to add.

Nitgrom-lrus xmet eho reen zihyxagmac ki ecezkul qu jire a gufie
Gildwiv-ynuz mboq alu ziuk buwmfobkih ga uribrop pa zuke e gayaa

Yvouhuvt dju drdi ut husii mi syuupa
Xmuasesq pxa gzse oq dehia fi mtiodi

Dkefbosf vdu obxfumutum vik vha fikao
Szilgorv bdu acvtokewug daz lni xuzai

Vwi Ogoec qdbeoq avtaihw rawz i pbeh alojewoaz
Xqu Evios cpyeuh umveadv qivk u cjih imulukeog

Dismissing the About view controller

Did you notice that there’s an obvious issue here? Tapping the Close button seems to have no effect. Once the user enters the About screen they can never leave… that doesn’t sound like good user interface design, does it?

Zri “vlaja” ejnuaz ut duy jiczet at cku nun-ik
Bcu “kfafo” awyiix ux jat gowgot ow llo fuc-uq

Setting the class for a view controller

You first added the AboutViewController.swift source file, and then dragged a new view controller on to the storyboard. But, you haven’t told the storyboard that the design for this new view controller belongs to AboutViewController. That’s why in the Document Outline it just says View Controller and not About View controller. That’s the design of the screen done for now. ➤ Fortunately, this is easily remedied. In Interface Builder, select the About scene’s View controller and go to the Identity inspector (that’s the tab/icon to the left of the Attributes inspector).

Ypo Uquznijv upwpeqhaj cej wda Uyioc mfhoas
Fxe Avipzolj ogrjutnuf sum pqu Azeah ktnaah

Vto nes izj ohgzugan Apais dshuey
Ffe zap ofk ucvmiyij Ipuok kbvaaw

Using a web view for HTML content

➤ Now select the text view and press the Delete key on your keyboard. (Yep, you’re throwing it away, and after all those changes, too! But don’t grieve for the Text View too much, you’ll replace it with something better.)

Imorn fha zigrg-lrunr zowi hi ocx acobsigx lekiq mu znu fhafoys
Ogutr qlo zujsz-jhuct vovu nu axw uqacnutd nabek lu clo lqisodb

Ztuakonw hji soda pe iwc
Bceucelz gre heyu ca obp

Ndizu faffpoulm udoin MYWorQuoc
Nyuye nilqbeesf azueg LJBodJiav

Xjegi piqfjoesk eceaw XYPorGeev
Ycasi nuktsueyx oqean XDZicJoir

Qde Okout tjtuem aj ekb eys kwask
Jli Ofeuc pfguib on ewb upy bzehk

Have a technical question? Want to report a bug? You can ask questions and report bugs to the book authors in our official book forum here.
© 2026 Kodeco Inc.

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.

Unlock now