0
votes

There are many questions on this topic and most of the answers are dated, so I am going to post this question.

Running Xcode 10.2.1 with Swift 5.1.

I have a UIPageViewController and I have set the Transition Style to Scroll in the Attributes Inspector.

enter image description here

However when I run the app in the simulator, Page Curl happens.

enter image description here

Is there a programmatic approach to make sure that the transition style is scroll?

2

2 Answers

1
votes

Just add init code and initialize transition style programmatically.

required init?(coder aDecoder: NSCoder) {
    super.init(transitionStyle: .scroll, navigationOrientation: .horizontal, options: nil)
}

enter image description here

1
votes

Swift 5.0

class PortalMasterController: UIPageViewController {

override func viewDidLoad() {

    super.viewDidLoad()
    let stype = self.transitionStyle

    if stype == .scroll {

        print("scroll")

    } else if stype == .pageCurl {

        print("pageCurl")
    }
  }
}