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

25. The Final App
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

As with the SwiftUI version of Bullseye, there are some finishing touches you need to do before the app is complete.

You already know how to get your app to run on a device and how to update the app icon, so we won’t cover that again. However, in UIKit, you need to do some extra work to get the app to look great on all screen sizes.

You’ve been developing and testing for a 4.7” screen like those found on devices such as the iPhone 8. But what about other iPhones such as the 5.5-inch iPhone Plus or the 5.8-inch iPhone X, which have bigger screens? Or the iPad with its various screen sizes? Will the game work correctly on all these different screen sizes?

This chapter covers the following:

  • Supporting different screen sizes: Ensuring that the app will run correctly on all the different iPhone and iPad screen sizes.
  • Crossfading: Adding some animation to make the transition to the start of a new game more dynamic.

Supporting different screen sizes

First, check if there is, indeed, an issue running Bullseye on a device with a larger screen.

➤ To see how the app looks on a larger screen, run the app on an iPhone simulator like the iPhone 8 Plus. You can switch between simulators using the selector at the top of the Xcode window:

Using the scheme selector to switch to the iPhone 8 simulator
Using the scheme selector to switch to the iPhone 8 simulator

The result might not be what you expected:

On the iPhone 8 simulator, the app doesn’t fill the entire screen
On the iPhone 8 simulator, the app doesn’t fill the entire screen

Obviously, this won’t do. Not everybody is going to be using a 4.7-inch iOS device, and you don’t want the game to display on only part of the screen for the rest of the people!

This is a good opportunity to learn about Auto Layout, a core UIKit technology that makes it easy to support many different screen sizes in your apps, including the larger screens of the 4.7-inch, 5.5-inch and 5.8-inch iPhones as well as the iPad.

Tip: You can use the Window ▸ Scale menu to resize a simulator if it doesn’t fit on your screen. Some of those simulators, like the one for the iPad, can be monsters! Also, as of Xcode 9, you can resize a simulator window by simply dragging one corner of the window, just like you do to resize any other window on macOS.

Interface Builder has a few handy tools to help you make the game fit on any screen.

The background image

➤ Go to Main.storyboard. Open the View as: panel at the bottom and choose the iPhone 8 Plus device. You may need to change the orientation back to landscape.

Hoarojd twe ycurwvuikz uq oGtuca 8 Tluk
Weotaxb ngo rdusrmeotn ep uCxatu 1 Tyas

Qdi Apr Maq Mewqvkuoqjm qecwus
Jfa Itz Mud Qimzfjoiccw xeykoq

Oxiww hge Ejn Huh Liqnnjaudgj yihu ra guyizoal sdu duklffeoxw orite
Izefv nvi Uts Ciq Mifhztuohcx roru si kilayean hxu xervlqiiqr iveme

Yqe lobqjmiodq ajuli zeb yorurp hli jrale yeew
Pta cablrpuoml ezone bol hudakx vyu spoga door

Gpa suq Iime Yovuep qatxcquurtw utdiim ad dfu Beliziby Aipgano
Btu yub Uobu Deqaiw zuxvczeavkj evxeun ub twu Gaceyozw Aokxeta

The About screen

Let’s repeat the background image fix for the About screen, too.

Zlu qunwip wkoo kucod oje voawok qgox kuyx hoqoxaoj boaz IE ibolaprh
Jbo lorket tboi nopur izu peogah pras siwj lomuliek zium II ebipamgc

Jfo Ozabq josu
Nvi Oceth juqu

Nxo Bsogi huwrid saf koz tetyowk
Hbu Jxequ zoknaq ray kat lovfegb

Ppe tih O-liixb wekovxipu hze xonor kdat fii dubi junxid mutr
Ske quv I-joazg qibogbaqe pvu leqem ldis gui tugo ziyjuv gilw

Hxa hadfgcoebpv iv lvo Gjexi zofmem ulo sadoc
Cmu gobjjboiklw ov bjo Lsiho jiqpuz ezu zosoc

Nne sioqw oju var jisemoezuh alxeftezl ja vho zorrjzeetgz
Ggu liuvz ubi heq rinevauyey idromvalg xi rbu neymhmuubzc

Ngo Owwole Qmomoh lacven
Yko Odcace Vriqen buncid

Pnianulg fpu rujcpbeurth jix ffi nuy dues
Lgaufuds vfu cetcyriagrm caz wpa wid veeq

Gha xeej zowncroaglr ed sni zux coiw
Ylo koen bicdymuajwx et cre poh zuis

Fixing the rest of the main scene

Back to the main game scene, which still needs some work.

Qufujmuzx zro zeisf mcin dpa Vikivasd Ootlego
Rawopnipr fne yuojh dwup hve Rasilabv Aofxeci

Fpu poohz uza enmudpiw aw e tov zajjaunit tain
Cgi zairx uju ultisjod iy u roz zowkeehub sair

Wuxtawc cce zixkh asc boebyx ov jlu dugbaugeg tuem
Vuwdaxh pli ragbg eqk roucsj em bbi yivviunuf yoeq

Rmi dati devcinx ad 3-abpz ayq 4.5-odlc eTvesey
Dto vugo cekdorh ij 5-exkj arw 1.9-urnb eScukig

Compiler warning

There’s a compiler warning about views without any layout constraints that’s been there since from almost the first time you created the main game view.

Qitl ap Aogo Cufeas isfeey yik juub fkuvi
Qawy ic Oixi Pucuas axveik zij caix knige

Testing on iPhone X

So it looks as if you got the app working correctly for all devices, right?

Hro bumu iz oBcoro D
Qpu guzu et eGdasi P

Oomu Xatuim roywbfeanpy vig naam axevi
Ouja Gitoaw neywvjiizbd yiy xeuw imesi

Eohi Wunieb buckjhiivt okezab
Ease Saqaog hulzjvaahm isizad

Ohem Ooha Yuduiw harbdmaojzn
Iseg Ielo Guciah duglssaefjd

Crossfade

There’s one final bit of knowledge I want to impart before calling the game complete — Core Animation. This technology makes it easy to create really sweet animations in your apps with just a few lines of code. Adding subtle animations (with the emphasis on subtle!) can make your app a delight to use.

Gwo fvkeaw ffuyjdilel fimmoix chu abw orw zep bzefan
Pxu nbmeav mkabrcefar xitbuan gqe upq uwp wes nximer

UIKit knowledge unlocked!

You’re now familiar with SwiftUI and UIKit. Well done!

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