This repository contains a fully functional SwiftUI application designed to demonstrate an effective way of implementing navigation using the Model-View-ViewModel (MVVM) architecture. By integrating NavigationStack
while keeping a clean separation between the ViewModel and View layers, this example showcases a practical solution to a common challenge faced in SwiftUI app development.
The example project illustrates a navigation framework within a SwiftUI application, using NavigationStack
, RootViewModel
, and a custom NavigationCoordinator
protocol. This approach aims to maintain the MVVM architectural integrity, promoting a structured and testable codebase.
- Demonstrates the use of
NavigationStack
in SwiftUI. - Implements MVVM architecture for clear separation of concerns.
- Provides a scalable solution for complex navigation flows.
- Includes unit tests showcasing how to test navigation logic.
- Xcode 15.x
- Swift 5
- iOS 16, iOS 17
Explore the app to see how navigation between different views is handled within the MVVM framework. Pay special attention to the RootViewModel
, NavigationCoordinator
protocol, and how each view model interacts with the NavigationStack
for seamless navigation.