|
|
|
|
|
by gregkerzhner
1782 days ago
|
|
How do you manage data flow from your view layer to your API layer? Like for example, if a UITableViewCell has a button in it which needs to load some data from the API? Do use an event/delegate which flows from the UITableViewCell through the `cellForRowAtIndexPath` method to the controller, out to some other class? It must feel pretty great to have your business logic and API layers abstracted into other classes, and have your lean view controller just be the glue. Yay MVC! Now imagine that your table view has 20 cells, and each cell is managed by a team of 5 people and needs 1,000 lines of code to fulfill its business logic. How would this approach hold up? Would you have all 100 people working on the same `cellForRowAtIndexPath` method, piping every event for those 20,000 lines of code through there? When people talk about scale on iOS, they are talking about potentially 100s of people working on the same screen. With something like React, this is trivial by having each team work independently on its own components. With iOS, its much harder out of the box. |
|
That’s pretty much the technique. :) Also, composition by child view controllers.