how to use two tableviews using button - ios

i want to use two tableviews like…..
i am using popover controller
first tableview is in the popover controller
in that popover controller i have two buttons(add notes button and remainder button)
when i click on the remainder button i am hiding the first tableview and enabling the second tableview
ut for the second tableview cellforrowatindexpath is not calling
only for the first tableview it is calling,not calling for the second table view
here my code is………..
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
if (tableView==self.remainderTableView)//second Tbleview {
static NSString *cellIdentifier=#"Celliden";
UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (cell==nil) {
cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellIdentifier];
}
cell.textLabel.text=#"hhh";
return cell;
}
else if (tableView==self.NotesandRemainderTable)//first Tableview {
static NSString *cellIdentifier = #"bookingCell";
CustomTableViewSwipeCell *cell = (CustomTableViewSwipeCell *)[tableView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath];
NSString *note=[jsondata valueForKey:#"TeacherNotes"];
NSLog(#"teacher notes %#",note);
// if (cell==nil) {
// cell=[[CustomTableViewSwipeCell alloc]init];
// }
// Add utility buttons
NSMutableArray *rightUtilityButtons = [NSMutableArray new];
[rightUtilityButtons sw_addUtilityButtonWithColor:
[UIColor colorWithRed:1.0f green:0.231f blue:0.188 alpha:1.0f]
title:#"Delete"];
_SubjectLabel.text=AppDel.sub;
NSLog(#"the date %#",AppDel.date);
_DateLabel.text=_dateToDisplay;
if (indexPath.section==0)
{
if (indexPath.row==0)
{
cell.Noteslabel.text=note;
}
return cell;
}
if (indexPath.section==1){
cell.Noteslabel.text=[_notesArray objectAtIndex:indexPath.row];
//NSLog(#"notes index %#",[notesArray objectAtIndex:indexPath.row]);
cell.rightUtilityButtons = rightUtilityButtons;
cell.delegate=self;
return cell;
}
}
//cell.rightUtilityButtons = rightUtilityButtons;
return nil;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
if (tableView==self.NotesandRemainderTable) {
if (section==0) {
return 1;
}
else if (section==1) {
if (leanerNots==nil || [leanerNots isEqual:[NSNull null]]) {
return 0;
}
else{
return [_notesArray count];
}
}
}else{
return 3;
}
return 0;
}
//This my remainder button code......
-(IBAction)addRemainderAction:(id)sender{
self.lineLabel.hidden=NO;
self.remainderTableView.hidden=NO;
self.addButtonObj.hidden=NO;
//self.remainderTableView.frame=CGRectMake(0, 62, 300, 321);
//[self.view addSubview:self.remainderTableView];
self.NotesandRemainderTable.hidden=YES;
self.notesBtnObj.hidden=YES;
self.remainderBtnObj.hidden=YES;
_SubjectLabel.hidden=YES;
}
Can any one help to solve this bug...i am new to Xcode

Did you set the datasource and delegate of your second tableview?
for example in viewDidLoad:
self.remainderTableView.datasource = self;
self.remainderTableView.delegate = self;
And you probably want to reload your tableviews before they are displayed. To do so use the following code for your second tableview
[self.remainderTableView reloadData];

It's not totally clear from this code whether you have set the delegate and dataSource correctly for both UITableView instances. If you have not, then these delegate methods will never get called.
Regardless, this case might be better handled by using two data sets instead of two tableViews. Implement cellForRowAtIndexPath the same way you are now, except instead of creating your cell conditionally based on the value of tableView, just use the value of your UIButton. Two UITableViews seems like overkill for this situation when the UITableViewDelegate and UITableViewDataSource methods allow you to source from different data sets easily already.

Related

Match TableViewCell's Label from other TableViewCell's Label

My problem is little complicated to define for me, even I understand what I am trying to do, I try my best to write this problem to understandable, guide me if I lack anything in question description.
So the problem is that I have a UITableView inside a UITableViewCell, both of UITableViews have custom UITableViewCell classes. Datasource and delegate of both outer an dinner UITableView's are in same class. I am handling the data array like this
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
if (tableView==self.mainTableView) {
return titleArray.count;
}
return timeArray.count;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
if (tableView==self.mainTableView)
{
MainTableViewCell *cell = [tableView dequeueReusableCellWitentifier:#"cell"];
cell.label.text = [dataArray objectAtIndex:indexPath.row];
return cell;
}
InnerTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:#"cell"];
cell.view.backgroundColor = [UIColor greenColor];
return cell;
}
My custom cell's description
Main UITableViewCell cusotm class properties - UILabel (eg.
myLabel),UITableView(inside)
Inside UITableViewCell custom class properties - UIView (eg.
myView)
Now I want to show myView only on that cell when 'myLabel' matches with my array of string object. for eg.
if([myLabel.text isEqualTostring:#"22"]){
cell.myView.backgroundColor = [UIColor blackColor];
}
For eg. if I have 5 views and 2 label, now 2 rows in Main UITableView and 5 rows in inside UITableView but every view should be in the outer cell
only if it matches the myLabel'text.
P.S Don't think about where matching data coming from its not an issue issue of matching data.
As a final conclusion I want to create different row count for each inner UITableView cell.
Did you tried this?
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
if( tableView == self.mainTableView )
{
MainTableViewCell *cell = [tableView dequeueReusableCellWitentifier:#"cell"];
cell.label.text = [dataArray objectAtIndex:indexPath.row];
return cell;
}
InnerTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:#"cell"];
MainTableViewCell *parentCell = (MainTableViewCell*)cell.superView;
NSIndexPath *parentIndexPath = [self.mainTableView indexPathForCell:parentCell];
NSString *text = [dataArray objectAtIndex:parentIndexPath.row];
if( [text isEqualTostring:#"22"] //your condition goes here
{
cell.view.backgroundColor = [UIColor blackColor];
}
else
{
cell.view.backgroundColor = [UIColor greenColor];
}
return cell;
}

Using multiple UITableViews in a XIB

I have created a custom widget as a XIB file where I have multiple UITableViews and a UIButton. In the corresponding swift file which is the owner of this XIB, I have outlets to these TableViews.
I have added this widget to a view inside a view in a UIViewController. Now in the corresponding swift file of this controller, I need to assign dataSource and delegate to each of the tableviews, and an action to the button.
I have been looking online for long, and seems like #IBInspectable vars are the way to go, but seems like I cannot make a var which of type UITableView,UITableViewDelegate or UITableViewDatasource as #IBInspectable.
So how do I use the tableviews and the button? Can anyone direct me to the correct documentation, example, or explain?
No need to use an #IBInspectable. You can simply use each table source within the UITableViewDelegate methods conditionally. Here's one way to go about doing this:
First within your storyboard's UITableViewController, add a prototype cell, then within that prototype cell add a UITableView with its own prototype cell.
Then set both the inner and outer table view cell's reuse identifiers like so:
Outer table view cell:
Inner table view cell:
Then link that inner tableview's data source and delegate to the UITableViewController's own data source and delegate:
Then within your UITableViewController class, you can set your tables' elements conditionally, for example:
- (void)viewDidLoad {
[super viewDidLoad];
dataSource1 = [NSArray arrayWithObjects:#"1", #"2", #"3", #"4", #"5", #"6", #"7", nil];
dataSource2 = [NSArray arrayWithObjects:#"a", #"b", #"c", nil];
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (tableView == self.tableView) {
return 80;
} else {
return 20;
}
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
// Return the number of rows in the section.
if (tableView == self.tableView) {
return dataSource1.count;
} else {
return dataSource2.count;
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell;
if (tableView == self.tableView) {
cell = [tableView dequeueReusableCellWithIdentifier:#"reuseIdentifier" forIndexPath:indexPath];
} else {
cell = [tableView dequeueReusableCellWithIdentifier:#"reuseIdentifier2" forIndexPath:indexPath];
}
// Configure the cell...
if (tableView == self.tableView) {
cell.textLabel.text = [dataSource1 objectAtIndex:indexPath.row];
} else {
cell.textLabel.text = [dataSource2 objectAtIndex:indexPath.row];
cell.backgroundColor = [UIColor blueColor];
}
cell.textLabel.backgroundColor = [UIColor clearColor];
return cell;
}
Which in this case produces the following result:

UITableView DataSource must return a cell from cellforRowAtIndexPath Error

I have two different tableViews in one view controller and I get an error message. The data source and delegate are set to the view controller. Am I doing something wrong in the tableview methods. I haven't dealt with more than one tableView in the same view before. Thanks
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
if (tableView == self.postsTableView) {
return 1;
}
else if (tableView == self.eventsTableView){
return 1;
}
return 1;
}
-(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
if (tableView == self.postsTableView) {
return 1;
}
else if (tableView == self.eventsTableView){
return 1;
}
return 1;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
if ([tableView isEqual: self.postsTableView]) {
profilePagePostCell *cellOne = (profilePagePostCell *) [tableView dequeueReusableCellWithIdentifier:#"profilePostCell"];
cellOne.postLabel.text = [NSString stringWithFormat:#"Hi"];
return cellOne;
}
if ([tableView isEqual: self.eventsTableView]) {
profileEventCell *cellTwo = (profileEventCell *) [tableView dequeueReusableCellWithIdentifier:#"profileEventCell"];
cellTwo.eventLabel.text = [NSString stringWithFormat:#"The big One"];
return cellTwo;
}
profileEventCell *cell = (profileEventCell *) [tableView dequeueReusableCellWithIdentifier:#"profileEventCell"];
return cell;
}
Unless you have already called registerClass:forCellReuseIdentifier: or defined a prototype class in your nib or storyboard on your UITableView, you're going to get nil cells back from that dequeReusableCellWithIdentifier: call. You can register one if you like, or you can create a local instance when you have received nil, making sure to call UITableViewCell initWithStyle:reuseIdentifier: as your initialization method.
I'm not seeing any immediate problems in your code. I assume those cells are registered properly in either a prototype cell or by registering them in code. If not then that is probably the issue. I would put a breakpoint in your cellForRowAtIndexPath: and step through the process to make sure its even being called for one, and make sure that it is in fact returning a cell. Make sure that the cell is not nil in all of your cases.
Not enough information but two among several reasons:
(1) You've not registered the two custom cells before trying to deque them.
If this is the case, register them while overridng viewDidLoad like follows.
[self.postsTableView registerClass:[profilePagePostCell class] forCellReuseIdentifier:#"profilePostCell"];
or
[self.postsTableView registerNib:#"YOUR_NIB_NAME" forCellReuseIdentifier:#"profilePostCell"]
(2) The identifier names you're using in cellForRowAtIndexPath method do not match what you registered in viewDidLoad method.
Double check the names and I strongly recommend you to use defined constant name in order to get support from Xcode.
You don't alloc memory for cells. Try this code:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath(NSIndexPath *)indexPath{
static NSString *cellIdentifierPosts = #"cellIdentifierPosts"
static NSString *cellIdentifierEvents = #"cellIdentifierEvents"
if ([tableView isEqual: self.postsTableView]) {
profilePagePostCell *cellOne = (profilePagePostCell *) [tableView dequeueReusableCellWithIdentifier:cellIdentifierPosts];
if (!cellOne)
cellOne = [[profilePagePostCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier: cellIdentifierPosts];
cellOne.postLabel.text = [NSString stringWithFormat:#"Hi"];
return cellOne;
}
else if ([tableView isEqual: self.eventsTableView]) {
profileEventCell *cellTwo = (profileEventCell *) [tableView dequeueReusableCellWithIdentifier:cellIdentifierEvents];
if (!cellTwo)
cellTwo = [[profileEventCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier: cellIdentifierEvents];
cellTwo.eventLabel.text = [NSString stringWithFormat:#"The big One"];
return cellTwo;
}
else{
profileEventCell *cell = (profileEventCell *) [tableView dequeueReusableCellWithIdentifier:cellIdentifierEvents];
if (!cell)
cell = [[profileEventCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier: cellIdentifierEvents];
cell.eventLabel.text = [NSString stringWithFormat:#"The default One"];
return cell;
}
}

Expanding and Collapsing table view cells in ios

I have a table view of custom cells and some buttons in each cell.Clicking on any of the button inside the cell will reveal another custom view below that cell.Next click on the same button will collapse the view and need this same for all cells.I tried with insertrow method on the button click but in vain.How can i do this with using only the table view delegates.
This is what i tried:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *simpleTableIdentifier = #"CustomCell_For_Dashboard";
CustomCellFor_Dashboard *customCell = (CustomCellFor_Dashboard *)[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
if (customCell == nil)
{
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:#"CustomCellFor_Dashboard" owner:self options:nil];
customCell = [nib objectAtIndex:0];
}
[customCell.howyoulfeelBtn addTarget:self action:#selector(buttonclicked:) forControlEvents:UIControlEventTouchUpInside];
customCell.nameLabel.text = #"test";
customCell.imgView.image = [UIImage imageNamed:#"Default.png"];
// customCell.prepTimeLabel.text = [prepTime objectAtIndex:indexPath.row];
return customCell;
}
-(void)buttonclicked:(id)sender{
NSIndexPath *indexPath = [myTable indexPathForCell:sender];
[myTable beginUpdates];
NSIndexPath *insertPath = [NSIndexPath indexPathForRow:indexPath.row inSection:indexPath.section];
[myTable insertRowsAtIndexPaths:[NSArray arrayWithObject:insertPath] withRowAnimation:UITableViewRowAnimationTop];
}
can anyone help me?
I got the same task on one project with just one thing different: There were no buttons, just tapping on cell will expand or collapse it.
There are several things you should edit in your code. First, the button method code will look something like this:
- (void) collapseExpandButtonTap:(id) sender
{
UIButton* aButton = (UIButton*)sender; //It's actually a button
NSIndexPath* aPath = [self getIndexPathForCellWithButtonByMagic:aButton];
//expandedCells is a mutable set declared in your interface section or private class extensiont
if ([expandedCells containsObject:aPath])
{
[expandedCells removeObject:aPath];
}
else
{
[expandedCells addObject:aPath];
}
[myTableView beginEditing];
[myTableView endEditing]; //Yeah, that old trick to animate cell expand/collapse
}
Now the second thing is UITableViewDelegate method:
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
if ([expandedCells containsObject:indexPath])
{
return kExpandedCellHeight; //It's not necessary a constant, though
}
else
{
return kNormalCellHeigh; //Again not necessary a constant
}
}
Key thing here is to determine if your cell should be expanded/collapsed and return right height in delegate method.
Going off of what #eagle.dan.1349 said, this is how to do it on the clicking of the cell. In storyboard, you also need to set the table cell to clip subviews, otherwise the content that would be hidden will show.
.h
#property (strong, nonatomic) NSMutableArray *expandedCells;
.m
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if ([self.expandedCells containsObject:indexPath])
{
[self.expandedCells removeObject:indexPath];
}
else
{
[self.expandedCells addObject:indexPath];
}
[tableView beginUpdates];
[tableView endUpdates];
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
CGFloat kExpandedCellHeight = 150;
CGFloat kNormalCellHeigh = 50;
if ([self.expandedCells containsObject:indexPath])
{
return kExpandedCellHeight; //It's not necessary a constant, though
}
else
{
return kNormalCellHeigh; //Again not necessary a constant
}
}
Saw this post and just wanted to give my 2 cents as my solution to this is very similar to the chosen answer (the tapping of a whole area).
Many people architect this by using just cells alone, but I believe there is a way to build this that might align better with what people are trying to achieve:
There are headers and there are cells. Headers should be tappable, and then cells underneath the headers would show or hide. This can be achieved by adding a gesture recognizer to the header, and when tapped, you just remove all of the cells underneath that header (the section), and viceversa (add cells). Of course, you have to maintain state of which headers are "open" and which headers are "closed."
This is nice for a couple of reasons:
The job of headers and cells are separated which makes code cleaner.
This method flows nicely with how table views are built (headers and cells) and, therefore, there isn't much magic - the code is simply removing or adding cells, and should be compatible with later versions of iOS.
I made a very simple library to achieve this. As long as your table view is set up with UITableView section headers and cells, all you have to do is subclass the tableview and the header.
Link: https://github.com/fuzz-productions/FZAccordionTableView
I also had a same situation and my solution was to put a button on top of the Section Title with viewForHeaderInSection method.
noOfRows defines how many rows are there in each section and button.tag keeps which button of section is pressed.
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
UIButton *btnSection = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, tableView.frame.size.width, tableView.frame.size.height)];
btnSection.tag = section;
[btnSection setTitle:[sectionArray objectAtIndex:section] forState:UIControlStateNormal];
[btnSection addTarget:self action:#selector(sectionButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
return btnSection;
}
- (void)sectionButtonTapped:(UIButton *)button {
sectionIndex = button.tag;
if (button.tag == 0) {
noOfRows = 3;
} else if (button.tag == 1) {
noOfRows = 1;
} else if (button.tag == 2) {
noOfRows = 2;
}
[self.tableView reloadData];
}
Hope this will help you..

UITableView in UIView in UIScrollview : On tap in UITableView data gets cleared

For work purposes I need to create a UIScrollView which embeds a UIView which in his turn embeds an UITableView via the container feature in Xcode.
My UIScrollView is a full page scrollview with Paging enabled.
My UIView is filled with a UIImage, some UIButton's and a container linking to a UITableView.
On initial launch, the data is loaded perfectly, meaning the UITableView is filled with the data, the UIImage is filled, and the Buttons are placed correctly.
But for some strange reason the when I try to tap or scroll in the UITableView in the container all the data from my UITableView gets cleared.
I'm posting this question here, as I have not found any other similar issue on StackOverFlow or any other website.
UITableViewCode:
- (void)viewDidLoad
{
[super viewDidLoad];
[self.productTable setBackgroundView:nil];
self.productTable.backgroundColor = [UIColor clearColor];
self.productTable.delegate = self;
self.productTable.dataSource = self;
}
- (void) viewDidAppear:(BOOL)animated {
/*CGSize tmp = self.productTable.contentSize;
self.productTable.frame = CGRectMake(0, 0, tmp.width, tmp.height * 3);*/
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
NSLog(#"section count : %i", [self.Products count]);
return [self.Products count];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
xcsSectionInfo *sectionInfo = [self.Products objectAtIndex:section];
if (sectionInfo.isOpen == NO) {
return 1;
} else {
return 3;
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
xcsSectionInfo *sectionInfo = [self.Products objectAtIndex:indexPath.section];
if (indexPath.row == 0) {
static NSString *CellIdentifier = #"Header";
xcsProductHeaderCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
cell.articleNumber.text = sectionInfo.product.articleNumber;
cell.articleColor.text = sectionInfo.product.articleColor;
cell.backgroundColor = [UIColor grayColor];
if (sectionInfo.isOpen == YES && sectionInfo == self.currentSectionInfo) {
cell.expandImage.image = [UIImage imageNamed:#"arrow_down.png"];
} else if (sectionInfo.isOpen == NO) {
cell.expandImage.image = [UIImage imageNamed:#"arrow_up.png"];
}
return cell;
} else if (indexPath.row == 1) {
static NSString *CellIdentifier = #"ProductHeader";
xcsProductTitleCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
cell.colorTempHeader.text = #"Color Temperature";
cell.sourceQualityHeader.text = #"Source Quality";
cell.sourceTypeHeader.text = #"Source Type";
cell.luminaireFluxHeader.text = #"Luminaire Flux";
cell.powerConsumptionHeader.text = #"Power Consumption";
cell.luminaireEfficacyHeader.text = #"Luminaire Efficacy";
cell.backgroundColor = [UIColor grayColor];
return cell;
} else if (indexPath.row == 2) {
static NSString *CellIdentifier = #"Product";
xcsProductCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
cell.colorTemp.text = sectionInfo.product.colorTemperature;
cell.sourceQuality.text = sectionInfo.product.sourceQuality;
cell.sourceType.text = sectionInfo.product.sourceType;
cell.luminaireFlux.text = sectionInfo.product.luminaireFlux;
cell.powerConsumption.text = sectionInfo.product.powerConsumption;
cell.luminaireEfficacy.text = sectionInfo.product.luminaireEfficacy;
cell.backgroundColor = [UIColor grayColor];
return cell;
}
}
#pragma mark - Table view delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
xcsSectionInfo *sectionInfo = [self.Products objectAtIndex:indexPath.section];
NSIndexPath *path0 = [NSIndexPath indexPathForRow:[indexPath row]+1 inSection:[indexPath section]];
NSIndexPath *path1 = [NSIndexPath indexPathForRow:[indexPath row]+2 inSection:[indexPath section]];
NSArray *indexPathArray = [NSArray arrayWithObjects: path0, path1, nil];
if (sectionInfo.isOpen == NO) {
sectionInfo.isOpen = YES;
[tableView insertRowsAtIndexPaths:indexPathArray withRowAnimation:NO];
} else {
sectionInfo.isOpen = NO;
[tableView deleteRowsAtIndexPaths:indexPathArray withRowAnimation:NO];
}
[self.Products replaceObjectAtIndex:indexPath.section withObject:sectionInfo];
[tableView deselectRowAtIndexPath:indexPath animated:YES];
self.currentSectionInfo = sectionInfo;
[tableView reloadData];
}
Btw.: I'm using storyboards
Regards and thanks in advance.
UPDATE 2:
I think a UIPageViewController would be more appropriate (link‌​). It looks like it accomplishes what you are trying to achieve. And probably much more simple than managing scroll views embedded in other scroll views.
UPDATE:
It looks like what you are trying to achieve is made possible in the UIPageViewController (link). If this works, it would be better than trying to manage scroll views embedded in other views.
Embedding a UITableView is specifically NOT recommended by Apple. Conflicts arise when the system is trying to figure out where to send events:
Important: You should not embed UIWebView or UITableView objects in
UIScrollView objects. If you do so, unexpected behavior can result
because touch events for the two objects can be mixed up and wrongly
handled.
(source)
But here is the stupid part, when you go to the source link, you will notice that appears in the docs for the UIWebView. Apple forgot to include it in the docs for UITableView.

Resources