I searched before posting this question, but couldn't find anything.
I'm having a huge issue. I have a scrolling type UIPageViewController as the basis of my app, with 3 view controllers.
One of the view controller's (listTableView) has a table view and a search display controller.
The problem is, I cannot scroll to the top of the table view when tapping on the status bar like a normal table view. I believe the UIPageViewController is interfering with this, but I have no idea how to go about fixing it, but I know that I need to for my app to not feel broken.
I appreciate any help offered.
I know someone will ask for code even though it's irrelvant in this case but here it is for creating the UIPageViewController:
#import "MainViewController.h"
@interface MainViewController ()
@property (nonatomic, strong) UIPageViewController *pageViewController;
@property (nonatomic, strong) NSArray *contentViewControllers;
@end
@implementation MainViewController
- (void)viewDidLoad
{
[super viewDidLoad];
self.pageViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"PageView"];
self.pageViewController.dataSource = self;
UIViewController *settings = [self.storyboard instantiateViewControllerWithIdentifier:@"Settings"];
UIViewController *listTableView = [self.storyboard instantiateViewControllerWithIdentifier:@"List"];
UIViewController *first = [self.storyboard instantiateViewControllerWithIdentifier:@"First"];
self.contentViewControllers = [NSArray arrayWithObjects:settings,listTableView,first,nil];
[self.pageViewController setViewControllers:@[first] direction:UIPageViewControllerNavigationDirectionReverse animated:NO completion:nil];
[self addChildViewController:self.pageViewController];
[self.view addSubview:self.pageViewController.view];
[self.pageViewController didMoveToParentViewController:self];
self.view.backgroundColor = [UIColor colorWithRed:(248.0/255.0) green:(248.0/255.0) blue:(248.0/255.0) alpha:1.0];
}
- (UIViewController *)pageViewController:(UIPageViewController *)pageViewController
viewControllerBeforeViewController:(UIViewController *)viewController {
NSUInteger index = [self.contentViewControllers indexOfObject:viewController];
if (index == 0) {
return nil;
}
return self.contentViewControllers[index - 1];
}
- (UIViewController *)pageViewController:(UIPageViewController *)pageViewController
viewControllerAfterViewController:(UIViewController *)viewController {
NSUInteger index = [self.contentViewControllers indexOfObject:viewController];
if (index >= self.contentViewControllers.count - 1) {
return nil;
}
return self.contentViewControllers[index + 1];
}