Design-wise, what would be the best way to design a UIPageViewController layout for reuse multiple times?

StackOverflow https://stackoverflow.com/questions/21712497

質問

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?

役に立ちましたか?

解決

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/

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top