SLPagingView
SLPagingView copied to clipboard
self.didChangePage not being called in iOS 9
This was working fine until I tried it on an iOS 9 device. The pageControl also is not updating where it was working fine before I tried iOS 9. Any thoughts?
__weak typeof(self)weakSelf = self;
self.didChangedPage = ^(NSInteger currentPageIndex) {
// do something
NSLog(@"page index: %i | scrollView: %@", (int)currentPageIndex, NSStringFromCGRect(weakSelf.scrollView.frame));
};
Do your "self" have SLPagingViewController type? Code below working on iOS 9 in my case.
SLPagingViewController *pageViewController = [[SLPagingViewController alloc] init ....];
pageViewController.didChangedPage = ^(NSInteger currentPageIndex) {
NSLog(@"pageDidChange");
};
Thank you @Eridana - yes, "self" is appropriate since my View Controller is a sub-class of SLPagingViewController. My issue turned out to be a problem combining SLPagingViewController with a side menu drawer controller - the view hierarchy was a little bit jacked up. Happy Thanksgiving!!