Search code examples
iosswiftuiscrollviewandroid-viewpageruipageviewcontroller

Fragments and ViewPager in iOS


I am transitioning from android to iOS and wondering is there a native way to create a page template consisting on a couple of UI elements and have it created N number of times programatically. In android this would be accomplished with a Fragment which is created in a ViewPager on every page change.

I know iOS has a UIPageViewController, but I cannot find a way to create it N time programmatically without using the storyboard.

Thank you,


Solution

  • I was able to solve my problem with a Container View which segues to a UIPageViewConroller. Visually illustrated here

    This was a helpful tutorial to get me started with UIPageViewControllerse