3 ms·
> Is this a joke? Do you have any professional iOS experience? Let’s just say that I can build a view controller for a large, multi-sectioned list where each s
by 3grdlurker 5y ago
> Is this a joke? Do you have any professional iOS experience?
Let’s just say that I can build a view controller for a large, multi-sectioned list where each section calls a different APIs and shows items with different layouts, and still end up with less than 500 lines of VC code even with generous line breaking. Oh, and I can make custom UICollectionView layouts with self-sizing headers and cells.
That said, your comment is just ad hominem and you should be downvoted to oblivion.
- swiftaccount1 5y agoYeah, sorry for the choice of words; I just fired something off with no editing. In my mind, I was thinking of MVC at it's worst (which is unfortunately common). That being said, would love to learn more about how you structure code. What does a project structure look like for you? I usually conceptually try to separate the view and data starting with the simplest file structure and dividing as needed.
- gregkerzhner 5y agoHow 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.
- 3grdlurker 5y ago> business logic and API layers abstracted into other classes, and have your lean view controller just be the glue That’s pretty much the technique. :) Also, composition by child view controllers.