I placed two Table View\'s onto my main.storyboard. I then created two new .swift class files for them: VideoTableViewController and LinkTableViewController. How do I link t
If you want 2 tableviews in the same view controller do the following:
Create a UIViewController that is a delegate to
UITableViewDelegate, UITableViewDataSource
Add 2 IBOutlets for the UITableViews in your ViewController.h file like this:
@property (nonatomic, weak) IBOutlet UITableView *tableView1;
@property (nonatomic, weak) IBOutlet UITableView *tableView2;
Connect the IBOutlets to these.
Add the delegate functions for the tableview in the .m file somethng like this:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in the section.
if(tableView == self.tableView1){
return whatever1;
}
if(tableView == self.tableView2){
return whatever2;
}
}