1、先获取UIPageViewController里面的UIScrollView:
-(UIScrollView *)findScrollView{
UIScrollView* scrollView;
for(id subview in _pageViewController.view.subviews){
if([subview isKindOfClass:UIScrollView.class]){
scrollView=subview;
break;
}}
return scrollView;
}
2、通过UIScrollView对滑动事件监听:
_scrollView.delegate = self;
-(void)scrollViewDidScroll:(UIScrollView *)scrollView {
NSLog(@"scrollViewDidScroll: %@, _pageViewController.view = %@",NSStringFromCGPoint(scrollView.contentOffset), _currentVC);
}