问题
I'm creating an app for iPad, and because of their size decided to do something a little different. I'm creating something like this:
I am using two UITableView in a UIView. I need to display data 'product categories' in the first TableView and 'products' in the second TableView.
The problem is display data in two tables with direferentes contents. Another detail: When a category is selected, the table 'product' is recharged with other data of other products.
My question is: How can I display data in two different TableView in the same View?
回答1:
Just add two Containers to your View Controller and drag from the container view to your desired Table View Controller and click embed. Then you'll need to make two separate UITableViewController Cocoa files and assign them to the table view in your Identity Inspector.
In this picture I've already attached the container on the left to my Table View Controller on the left.
来源:https://stackoverflow.com/questions/34213813/display-data-in-two-different-tableview-in-the-same-view-in-swift