In storyboards I've created an UIViewController and added more two UIViews to the same storyboard. Then added UISegmentedControl to enable switch between these UIViews.
The method I use to switch between UIView:
-(IBAction)segmentValueChaged:(id)sender
{
if(self.segment.selectedSegmentIndex==0)
{
[self.coinageView removeFromSuperview];
[self.view addSubview:nominalsView];
[self populateNominals:self.subCountryID];
}
else
{
[self.nominalsView removeFromSuperview];
[self.view addSubview:coinageView];
}
}
And the method which adds a UITableView on an UIView:
-(void)populateNominals:(int)subCountryID
{
UITableView *nominalsTableView=[[UITableView alloc]initWithFrame:CGRectMake(0, 0, 320, 372) style:UITableViewStylePlain];
//nominalsTableView.dataSource = self;
//nominalsTableView.delegate = self;
[self.nominalsView addSubview:nominalsTableView];
}
This approach works fine and I'me getting a table popped up when switching the segment.
My question is, where can I customize every tableView for every segment (UIView)? The problem is that I need two quite-different-looking tables (different design, cellForRowAtIndexPath and different navigation while didSelectRowAtIndexPath).
Thank you in advance.