Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
SwiftUI Tic Tac Toe Online Multiplayer Game for iOS 15, MVVM
Highest Rated
Rating: 4.6 out of 5(21 ratings)
155 students

SwiftUI Tic Tac Toe Online Multiplayer Game for iOS 15, MVVM

Develop multiplayer online game with SwiftUI, Firebase and iOS 15. Learn how to write iOS apps with SwiftUI using MVVM
Created byDavid Kababyan
Last updated 8/2021
English

What you'll learn

  • SwiftUI
  • Firebase
  • iOS 15 game development
  • MVVM Architechture

Course content

1 section26 lectures4h 56m total length
  • Creating Home View12:36

    Create a SwiftUI iOS 15 tic tac toe app using MVVM by building a home view with a play button that presents a full screen game view.

  • Refactoring home view to MVVM7:02

    Refactor the home view to MVVM by creating a reusable game button with dynamic title and background color, and add a home view model with a published isGameViewPresented.

  • Creating Game View9:35

    Organize and implement the game view in a SwiftUI tic tac toe app on iOS 15 using MVVM, including waiting and loading views, a 3x3 grid, and responsive circles.

  • Building Game Grid View6:47

    Use geometry reader to size a three-column tic tac toe grid with spacing and 0.7 opacity. Render X or O from system images, starting with a placeholder and updating on click.

  • Refactoring Game Grid View7:40

    Refactor the game grid view in SwiftUI for a tic tac toe iOS 15 MVVM app using a geometry proxy, and implement background, player indicator, and on-tap gestures.

  • Adding Loading Indicator5:07

    Implement a leading loading indicator in SwiftUI for the iOS tic tac toe online multiplayer game, using a progress view. Use a full-screen system color background and scale progress view.

  • GameView Model setup7:13

    Build the game model as an observable object and move columns into a game view model, then use environment presentation mode to dismiss on quit.

  • Game Logic and Model Setup15:27

    Explore the online multiplayer tic tac toe game logic and model setup, implementing moves, player turns, win/draw checks, and real-time Firebase synchronization with MVVM architecture.

  • Testing the board with Game Object17:05

    Create a game object in the view model to test moves offline, initialize nine empty moves, check occupancy, and process player moves with published updates for multiplayer readiness.

  • Checking for Win and Draw patterns9:23

    Implement win and draw checks for a tic tac toe game by modeling nine positions, using compactMap to filter out empty spots, and comparing moves against predefined winning index patterns.

  • Finishing Win pattern identification10:03

    Determine a winner by filtering a player's moves, transforming them into position sets, and matching against wind patterns; handle blocked moves and draw logic to control turns.

  • Saving and loading current user16:10

    Create a local user model with an automatically generated id and persist it to user defaults, enabling the app to load the current user and join or start online games.

  • Adding firebase to our project with Swift Package manager16:34

    Learn how to add Firebase to an iOS project using Swift Package Manager, initialize Firebase at app startup, and enable real-time updates with Firestore for a multiplayer game.

  • Firebase helpers setup13:27

    Set up Firebase helpers to manage a game collection in Cloud Firestore, using a singleton Firebase service to create, access, and monitor game state in real time.

  • Start Game function and Firebase Service22:24

    Implement the start game function by checking firebase for an available game, then join or create a game with the user id, and listen for changes to update the game.

  • Create game functions9:09

    Create a new online tic tac toe game by assigning player one, managing blocks and joins, and saving the game to firebase with encoded data.

  • Creating game in firestore13:07

    Start the game flow on game view load by calling the firebase service to join or create a game and listen to the published game object with Combine.

  • Delete game function8:44

    Implement delete game function to remove the game document from Firebase when a player quits, preventing abandoned games and enabling new matches. Ensure safe optional handling and join logic.

  • Update game function8:47

    Update game function enables joining an existing online tic tac toe game by updating the game object in firebase, using required query indexes.

  • Listen to changes and update the game UI18:59

    Listen for real-time changes in a SwiftUI tic tac toe online multiplayer game with a Firebase document snapshot listener, updating the published game object.

  • Check player to identify them by X/O mark11:41

    Dynamically identify whether the local player is X or O using the current user id, then update the game state on every change to detect wins and notify the player.

  • Creating Alert object8:35

    Create a dynamic alert system for a SwiftUI MVVM tic tac toe game by adding an AlertItem model with identifiable id, title, message, and patterns for win and quit.

  • Showing alerts to user14:05

    Explain how to implement user alerts in a SwiftUI MVVM game by using an optional alert item published from the game view model, handling win, lose, rematch, and quit.

  • Reset game function12:11

    Explore the reset game function for a SwiftUI mvvm tic tac toe online multiplayer, managing a rematch IDs array, resetting moves and winner state, and updating firebase to start game.

  • Game Notifications14:18

    Build a game notification system for a SwiftUI MVVM tic tac toe online game. Update states waiting for player, started, finished via a published notification in the view model.

  • Source code0:01

Requirements

  • xCode (Free from AppStore)
  • Basic knowledge of SwiftUI and Swift

Description

In this course, we will build ios 15 Game of TicTacToe. We will start from scratch and write every single line of code. This course is not for absolute beginners. You need to know your way around XCode and also have experience in application building or general programming experience.

The course will cover multiple topics. At the end of this course, you will have a very good foundation to build on more functions in order to make this AppStore-ready game.

  • SwiftUI

  • XCode

  • MVVM

  • iOS15

  • Swift Package Manager

  • Firebase Firestore

  • Data Structuring and transferring in SwiftUI

Check out my other reviews and other courses as well. I am teaching since 2012 and have tens of thousands of active and happy students.

Any questions, just ask in the Q/A section and I will get back to you ASAP.


I provide only high-quality courses and super customer service. Don't waste your time on other cheap courses with no support.

All the courses are explained throughout and made as clear as possible.

We offer 30 days no questions asked money-back for all our courses.

You have no risk at all, try our course and you will become one of our many happy students.


Don’t forget to check out our other courses as well.

Who this course is for:

  • Who has basic knowledge of iOS development and wants to increase his knowledge