Build a complete SwiftUI game with clean MVVM architecture, dependency injection, and an AI bot engine. Learn real-world game state management, animated win detection, and modular service patterns.
100% SwiftUI
Native framework
MVVM + DI
Clean architecture
AI Bot Engine
3 difficulty levels
Light & Dark
Full theme support
Features
A complete game with polished UI, smart AI, and clean architecture patterns you can learn from and reuse.
Configure every match before it starts. Play against a friend or challenge the AI bot with three difficulty levels. Customize player names and symbols for a personal touch.
A polished 3x3 grid with fluid animations on every move. Track turns in real time, persist scores across rounds, and enjoy a responsive, native-feeling game experience.
When a player wins, the winning path lights up with a smooth animation. A game over sheet reveals the results, and round tracking keeps the competition going.
The AI bot service is fully modular and separated from the game logic. Three difficulty levels drive different decision-making strategies, from random moves to optimal play.
Every screen adapts seamlessly between light and dark themes. The source code demonstrates proper color asset management and adaptive UI patterns for both appearances.
Architecture
This project demonstrates production-level game architecture in SwiftUI. Every layer is separated, testable, and easy to understand.
ViewModels manage game state and business logic. A Factory pattern provides dependency injection for clean, testable code.
Game validation, win detection, and bot logic are each their own service — easy to test, swap, or extend independently.
Separated game state from UI state. Clean data flow between board model, player turns, scores, and game outcomes.
The AI bot is a standalone service with difficulty-specific strategies — from random picks to blocking and optimal play.
Declarative UI with proper view composition, reusable components, and smooth spring animations throughout the app.
A dedicated service checks all win conditions (rows, columns, diagonals) and returns the winning path for animation.
What's Included
A complete, ready-to-build Xcode project with every file, service, and pattern documented in code.
Complete, ready-to-build project. Open in Xcode, run on Simulator or device. No setup required.
Professional MVVM architecture with Factory-based dependency injection for clean, testable code structure.
Three difficulty levels with distinct strategies. A modular bot service you can study and extend.
Winning combinations animate with smooth transitions. Learn how to build polished game animations in SwiftUI.
Persistent score tracking across rounds. See how game state is managed cleanly with separated concerns.
Full theme support with adaptive colors and proper asset management. Every screen looks polished in both modes.
Get Started
Get the complete Xcode project with MVVM architecture, AI bot engine, and polished SwiftUI game patterns. Learn by studying real, shipping-quality code.
Get Source Code