Disable/enable scrolling in UIPageViewController

后端 未结 5 938
轮回少年
轮回少年 2020-12-31 14:50

I got a viewController which inherits from UIPageViewController ( @interface PageScrollViewController : UIPageViewController ) Now I\'

5条回答
  •  抹茶落季
    2020-12-31 15:05

    Setting the UIPageViewController dataSource property to nil prevents scrolling, because the page view controller does not have a way to determine the "next" view controller to transition to.

    self.dataSource = nil // scrolling disabled
    
    self.dataSource = self // scrolling enabled
    

提交回复
热议问题