Goal: to make a viewcontroller have multiple pages and can be swapped through a segmented controller, pages content are scrollable vertically
details:
I made a pagviewcontroller and embedded it as a subview to main viewcontroller
//add pageviewcontroller as subview to viewcontroller if let vc = storyboard?.instantiateViewControllerWithIdentifier("ProfileEditController"){ self.addChildViewController(vc) self.view.addSubview(vc.view) EditTabs = vc as! UIPageViewController EditTabs.dataSource = self EditTabs.delegate = self //define First page EditTabs.setViewControllers([pagesAtIndexPath(0)!], direction:.Forward, animated: true, completion: nil) EditTabs.didMoveToParentViewController(self) //bring segmented view buttons to front of pageViews self.view.bringSubviewToFront(self.topTabs) }
I called pageViewController functions, and I am adding pages through restoration Identifiers
I managed segmented view controller by getting pageindex and setting viewcontroller like this:
EditTabs.setViewControllers([pagesAtIndexPath(0)!], direction:.Reverse, animated: true, completion: nil)
in story board the sub pages has scroll view inside to hold the content
I tested subpages scroll view by calling it through segue and its working fine
Case:
- everything work fine Only scroll view of subpages are not working at all
How to solve this issue? your guidelines will be much appreciated
Thanks,