Exploring MusicKit and Apple Music API
Unlock the full power of MusicKit & Apple Music APIs in your apps with the best guide! Use code musickit-blog for a limited-time 35% discount!
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:
- How to use the coordinator pattern in iOS apps series by Paul Hudson.
- How to use the Coordinator Pattern in SwiftUI by Paul Kraft.
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!
Exploring MusicKit and Apple Music API
Unlock the full power of MusicKit & Apple Music APIs in your apps with the best guide! Use code musickit-blog for a limited-time 35% discount!