MENU

Fun & Interesting

Swift Tutorial: How to use Coordinator Pattern with MVVM - Advanced Navigation in UIKit & SwiftUI

Karin Prater 43,948 3 years ago
Video Not Working? Fix It Now

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 https://youtu.be/vL0w3kvng0o 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/courses/swiftui-course 👨‍💻 my Core Data and SwiftUI course https://school.swiftyplace.com/courses/swiftui-and-core-data 👩🏻‍💻 Combine course https://school.swiftyplace.com/courses/master-combine-framework ⬇️ Project files: https://github.com/gahntpo/CoordinatorProject #SwiftUI #iOSDevelopment

Comment