Coordinator pattern is the latest “buzz word” that’s been going around in the iOS world although this pattern was already there from 2015 but recently it has caught the attention of many iOS devs and today we will try to find out how much value does this pattern provides in our application.
The scope of this article is not to explain what the coordinator pattern is and how we can implement it, but it is to determine the worth of adding this pattern in our projects.
If you know the Hindi language then do check out my YouTube channel where I have explained what this pattern is along with how we can implement clean coordinators in a 3 part video. The 3rd part is where I present how we can implement clean coordinators with protocol-driven programming.
Coordinator pattern is a fancy term for the delegate protocol pattern.
This delegate pattern isolates the navigation controller from the view controller and takes over the navigation responsibility.
Using the coordinator pattern we don’t have to use the segues for navigation, also we don’t need to write all that navigation code inside the view controller.
So this means using this pattern we decouple the navigation related task from the view controller and delegate the navigation responsibilities to the coordinator class.
Mission accomplished, no more coupling between the view controller and navigation. Plus now a single class is managing the navigation so SRP (Single responsibility principle)
But wait, every pattern has a trade-off and we must understand what those trade-offs are before we start celebrating and implementing this pattern in our client projects.
The very first thing is the need for the pattern, if one simply implements a pattern for no reason then it’s an abuse of the pattern.
Full Article: Codecat15 @ Medium
Mobile App Development Best Practices – 21.09
iOS Closures vs. Delegates in Swift iOS How to use the new inspector SwiftUI view modifier How to create an...
2023 App Threat Report
In 2022 alone, the number of mobile app downloads surpassed a staggering 200 billion, emphasizing the pervasive presence of these...
ElectricSQL – Local-first sync layer for web and mobile apps
Local-first sync layer for web and mobile apps. Build reactive, realtime, local-first apps directly on Postgres. What is ElectricSQL? ElectricSQL...
GitHub Copilot Chat opened to individual developers
Like similar chatbots, Copilot Chat sits in the sidebar of the IDE, and developers can use it to have lengthy...
ComposeCard – A beautifully designed payment view library
ComposeCards is a beautifully designed payment view library for Credit and Debit Cards. Made using Jetpack Compose 🎉. It allows...
Mobile App Development Best Practices – 20.09
Airship has released another study of mobile users aka shoppers. A lot of interesting things about habits and tasks in...