Search code examples
iosswiftxcodeuipageviewcontrollerxcode10

Differing options for UIPageViewController.transitionStyle in Xcode GUI vs Programmatic Enum


I'm using a storyboard to build an app where one page requires a UIPageViewController within a ContainerView. Everything works fine, but I'd like to use the scroll transition style rather than the default "page turn" animation.

Looking at the apple docs I get two options - page curl and scroll, but when I open what I assumed would be the corresponding menu in XCode, I get the options below.

Transitional Style Xcode Options

Note - regardless of which option I select in this menu, printing self.transitionStyle.rawValue on my subclass of UIPageViewController gives me "0", which corresponds to the pageCurl case of the TransitionStyle enum (see below).

enter image description here

Am I missing something? Does that drop-down refer to some other transitional style?


Solution

  • You look at UIViewController's modal transition style not UIPageViewController's one. If you create UIPageViewController in Storyboard you'll see another transition style in "Page View Controller" block in Interface Builder.

    About UIViewController's transition style you can read here.

    Page View Controller