Question

I'm using UIPageViewController in order to create a paging, zooming photo gallery akin to Photos.app.

Each UIViewController within the UIPageViewController will have a similar layout, consisting of a UIImageView for displaying the image and a UILabel for displaying a caption for the image.

This will be used multiple times for displaying different user galleries (think of a Flickr app where the user can tap to view a certain gallery/album).

How would I best go about designing this so I could reuse it easily, and with an object-oriented style design?

In code somehow? Do I subclass something (before iOS 6 you weren't allowed to subclass UIPageViewController, so what if that was still the case)? Is it possible to design it in something like a storyboard and then reuse that "template" in code?

Was it helpful?

Solution

You don't need multiple UIPageViewControllers, just set up one with the layout you want and use it whenever you need a PageViewController.

Here is a tutorial that helped me understand how they work: http://www.appcoda.com/uipageviewcontroller-storyboard-tutorial/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top