Skip to content

Latest commit

 

History

History
30 lines (19 loc) · 1.36 KB

README.md

File metadata and controls

30 lines (19 loc) · 1.36 KB

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.