I struggled with this for a while and thought I should post my solution, following from Jessc's answer; Removing the PageViewController data source.
I added this to my PgeViewController class (associated with my storyboard page view controller in a storyboard, it inherits both UIPageViewController and UIPageViewControllerDataSource ):
static func enable(enable: Bool){ let appDelegate = UIApplication.sharedApplication().delegate as! AppDelegate let pageViewController = appDelegate.window!.rootViewController as! PgeViewController if (enable){ pageViewController.dataSource = pageViewController }else{ pageViewController.dataSource = nil } }
This can be caused when everyone appears under the view (in this case, turn it off);
override func viewDidAppear(animated: Bool) { PgeViewController.enable(false) }
I hope this helps someone, but not as cleanly as we would like, but not too cool, etc.
EDIT: if anyone wants to translate this into Objective-C, please :)
Jamie Robinson Sep 10 '15 at 9:38 2015-09-10 09:38
source share