I have a UIViewController
that should be capable of displaying tableView
s with multiple data sources. The UITableView
spans about half the size of the screen, and there is and up and down button that allows you to go through different data. Everytime the up and down button is hit, I'd like to ultimately use UIViewAnimationTransitionCurlDown
or something similar to display the next UITableView
.
The question is: do I need multiple UIViewControllers
to do this, with a tableView
embedded in each one? Should I just create one instance of UITableView
and change its data source when an up or down button is hit? If it's only one instance of UITableView
, how do I manage to get a curl transition over the portion of the screen it takes up to make it look like a new tableView
is coming in?
Why not have each table view belong to its own UITableViewController
, and nest these within the current screen's view controller? This way the screen's view controller is responsible for swapping out its subviews, each of which have a table view controller containing the necessary logic to show their data.
In the end, it comes down to what your functionality and data sets look like. It may end up being easier to implement the table view datasource & delegate code once, injecting an actual data source into this class - or it may be easier to write custom datasource code for each table view.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With