1. Let’s set up the Slot Machine iOS and macOS app project in Xcode

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. 

  1. 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.

  2. The red folder contains all of the resources you will need to build the Slot Machine game.

  3. Finally, we are going to save this app into the blue folder. 

Slot Machine Game

Buy nowLearn more

Introduction

  • What you will learn and develop?

Resources

  • SwiftUI-App-Workbook-Slot-Machine.pdf
  • SWIFTUI-APP-SLOTMACHINE.zip
  • Slot-Machine-iOS-App.zip

Lectures

  • Preview Video
  • 1. Let’s set up the Slot Machine iOS and macOS app project in Xcode
  • 2. Let's build up the Slot Machine minigame’s header view
  • 3. Let's build up the Slot Machine minigame’s main view with the reels
  • 4. Let's build up the Slot Machine minigame’s footer view
  • 5. Let's create the Info View with SwiftUI form
  • 6. How to develop the main logic of the game with Swift
  • 7. Let’s develop the logic of the betting system with Swift
  • 8. How to create a custom popup window for the Game Over
  • 9. How to store and retrieve data permanently - Introduction to User Defaults
  • 10. Add animation to the Slot Machine game using SwiftUI
  • 11. Add sound effects and a background music to the SwiftUI game
  • 12. Let’s create your first macOS app using the Mac Catalyst framework
  • 13. Let's create an amazing Sticker Pack without a single line of code