Search code examples
iosswiftuipageviewcontroller

Page View Controller :custom page slider


I am trying to implement a feature using PageViewController in iOS Swift language. In my scenario there will be images on all views associated with PageViewController. I will have buttons on top of images, (refer to example app's screenshot.) How can I implement that with change of page only the image slides not the buttons.

enter image description here


Solution

  • Finally I was able to do it, by following steps:

    1. In your storyboard, create a standard Viewcontroller scene.
    2. To this scene add your fixed buttons and a container view. Adding the container view will automatically add an embedded view controller. Select this and delete it.
    3. Drag a Page view controller into the storyboard.
    4. Select the container view and drag from the "viewDidLoad" item in its "triggered segues" list to the page view controller. Select "Embed" as the segue type.