I am basically just asking here as the blog didn't have a commenting area.
Looking around at Coordinator patterns, I struggle a bit with knowing where to place the actual business logic. In your example, at least I can see that you put it in the Coordinator itself. However this makes me wonder about a few things.
-
Extensions makes it nice in Swift to separate the logic, but what about Objective C, it feels like using categories would be the equivalent?
-
If a view controller always needs to be setup with data X from a service. That means the (as in your blog post) logic for errors and actual api calls need to be duplicated in multiple coordinator classes?
-
Just an observation, there will be a lot of business logic in the coordinator the more steps it have. Which is maybe annoying, I'm considering that maybe these steps would be able to be moved into a "business logic" class (maybe ViewModel type of thing). Wondering if you came across this in the final application. This also ties into the 2nd questions, with duplication.
-
If you have e.g. a menu and one "flow" consists of only one view controller, would it still have a specific flow class for that one? (not exactly sure about this questions but I'll add it anyway)
I am basically just asking here as the blog didn't have a commenting area.
Looking around at Coordinator patterns, I struggle a bit with knowing where to place the actual business logic. In your example, at least I can see that you put it in the Coordinator itself. However this makes me wonder about a few things.
Extensions makes it nice in Swift to separate the logic, but what about Objective C, it feels like using categories would be the equivalent?
If a view controller always needs to be setup with data X from a service. That means the (as in your blog post) logic for errors and actual api calls need to be duplicated in multiple coordinator classes?
Just an observation, there will be a lot of business logic in the coordinator the more steps it have. Which is maybe annoying, I'm considering that maybe these steps would be able to be moved into a "business logic" class (maybe ViewModel type of thing). Wondering if you came across this in the final application. This also ties into the 2nd questions, with duplication.
If you have e.g. a menu and one "flow" consists of only one view controller, would it still have a specific flow class for that one? (not exactly sure about this questions but I'll add it anyway)