Skip to content

will-lumley/swiftui-navigation-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SwiftUI MVVM Navigation Example

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.

Project Overview

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.

Key Features

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

Getting Started

Prerequisites

  • Xcode 15.x
  • Swift 5
  • iOS 16, iOS 17

Usage

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.

About

This is an example project to go with my SwiftUI Navigation blog. https://lumley.io/blogs/swiftui-navigation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages