SetSwiftUI is an interactive iOS application implementing the popular card game Set, built using SwiftUI. This project is built using the MVVM architectural pattern and the focusing is on creating an engaging user experience with eye-catching animation.
- Model-View-ViewModel: This architecture was chosen to separate logic and UI in order to enhance maintainability and scalability. The
SetGame
Model handles the game logic, theSetGameView
View manages the UI and theSetGameViewModel
ViewModel binds the View to the Model, interprets the Model on behalf of the View and communicates user intentions from the View to the Model.
- Implicit and Explicit Animations: Smoothly integrated for user interactions.
- Transitions and Matched Geometry Effect: Enhance the visual appeal by animating view appearances and movements.
- ViewModifier for Cards: Cardify is a custom ViewModifier that stylizes standard views into game cards, showcasing reusability in SwiftUI.
- Custom Diamond Shape: Demonstrates UI drawing using path(in:).
- GeometryReader: Ensures that the UI dynamically adapts to different device sizes.
- LazyVGrid with Adaptive Layout: AspectVGrid uses this to provide a responsive card layout.
- Game Logic: SetGame struct contains all game logic, maintaining clean separation from the UI.
- Triad Enum: Used for card properties, demonstrating efficient use of Swift enums.
- Card State Management: The SetGame.CardState enum manages various states of a card like selected, matched, and mismatch.