Swift Tutorial: How to use Coordinator Pattern with MVVM - Advanced Navigation in UIKit & SwiftUI
Karin Prater Karin Prater
16.3K subscribers
37,086 views
0

 Published On Apr 22, 2022

In this advanced iOS tutorial I want to talk about the Coordinator pattern.
This pattern might be for you if you want to write a Swift app with a very flexible architecture which is modular and scalable.
I will show you a nice example with different app flow scenarios.
I use Combine to pass data between different Coordinators. I am also including MVVM (Model-View Model-View). In this demo project I will share the same view model between 2 different view/view controllers.
I will show how to programmatically show multiple different UIViewControllers together in a UINavigationViewController.
The data flow is done with the Combine framework because SwiftUI already relays heavily on it and I want to keep one with one consistent style.
I want to use both UIKit views and SwiftUI views to make the app architecture as flexible as possible.

Overview
00:00:00 introduction
00:06:09 MVC, MVVM and Coordinator pattern
00:13:29 Communication patterns: Combine
00:19:21 project setup
00:23:50 Coordinator implementation
00:49:03 data flow between Coordinators, view models and views
01:14:38 wrap up

Watch more
SwiftUI navigation tutorial    • SwiftUI tutorial: How to navigate pro...  

If you liked what you learned and you want to see more, check out one of my courses!
👨‍💻 my SwiftUI course https://school.swiftyplace.com/course...
👨‍💻 my Core Data and SwiftUI course https://school.swiftyplace.com/course...
👩🏻‍💻 Combine course
https://school.swiftyplace.com/course...

⬇️ Project files: https://github.com/gahntpo/Coordinato...

#SwiftUI #iOSDevelopment

show more

Share/Embed