Reputation: 213
I am working on an iPad app. I have a scrollview that will contain at least 4 tables, all very dynamic meaning that the content of the tables depends on the interaction with the user. This results in quite a bit of code in the ScrollViewController. I would like to split the responsibility for the tables to separate classes but I am unsure how to do this.
I have considered using a ViewController per table but I cant get this to work while keeping the tables embedded in the scrollview (IOS should not load a new view).
I also considered using one table with segments. This would work, but would not reduce the amount of code in the ScrollViewController, so its not really a solution.
Upvotes: 0
Views: 40
Reputation: 31016
Consider a container view controller that manages four child view controllers. The container is responsible for managing the display space that the others use but each of them is responsible for their own content. If you're using a storyboard, it becomes even easier with container views and embed segues.
View Controller Programming Guide
Upvotes: 1