1. Let’s set up the Slot Machine iOS and macOS app project in Xcode
In this SwiftUI class, we’re going to build a Slot Machine game, an outstanding iOS, iPadOS, and even a macOS app with SwiftUI.
At the beginning part of the class, we will create a very impressive game interface with many gorgeous graphics that were made by myself for this course. If you are curious, then I can tell you that I designed those graphic assets using a professional vector drawing iPad application with my Apple Pencil.
In the middle part of this SwiftUI class, we will develop the main game logic with Swift. Then we will learn how to save and read the High Score using the User Defaults. We can use User Defaults to store any basic data type for as long as the app is installed. You will see how easy is to use it with SwiftUI.
In the last part of this SwiftUI class, we will learn how to bring an iPad app to Mac by using Apple’s Catalyst technology. With Mac Catalyst, our Slot Machine iPad app shares the same project and source code therefore we can efficiently convert this mobile app to desktop.
Without further ado let’s set up our project as usual in Xcode. Download the resource files from this section. Then place it on the Desktop and unzip it by clicking on the package.
The provided main folder contains 3 folders marked with the Swift logo and supplementary workbook files with the objectives in PDF and ePub formats.
- As you know by now, you can find the completed project in the green folder. This finished project with the source codes may help you when you are stuck and need some quick help.
- The red folder contains all of the resources you will need to build the Slot Machine game.
- Finally, we are going to save this app into the blue folder.