Implementing Coordinator Pattern in SwiftUI
Book

Exploring Freelancing

Navigate freelancing as a developer; find clients, manage contracts, ensure timely payment, and learn from experiences!

Last year, I worked on a project where I had to refactor the app with multiple similar XIBs. I had the option to use SwiftUI to replace the views and the existing structure.

I wanted to have a pattern where I can abstract the navigation from the views to have a separate entity managing them.

After searching, I stumbled across the Coordinator Pattern by Soroush Khanlou. There are a few more inspiration posts I referred to:

I started with my own implementation that suited the project and this post is an implementation of how I went about it.

This is my own view and opinion. I’m happy to hear your views on how you use the coordinator pattern.

Conclusion

Working with SwiftUI is fun and not so fun. For custom scenarios like these, you’ve to resort to UIKit and look for workarounds.

If you have a better approach, please tag @rudrankriyam on Twitter! I love constructive feedback and appreciate constructive criticism.

Thanks for reading, and I hope you’re enjoying it!

Book

Exploring Freelancing

Navigate freelancing as a developer; find clients, manage contracts, ensure timely payment, and learn from experiences!

Written by

Rudrank Riyam

Hi, my name is Rudrank. I create apps for Apple Platforms while listening to music all day and night. Author of "Exploring MusicKit". Apple WWDC 2019 scholarship winner.