View Scrolling Paging Using Child View Controllers

What is the best practice for implementing horizontal scroll view with swap, with one view controller per page?

Is PageControl an example still the best way to implement this now that iOS5 has an API for containers / containers to view?

+7
source share
6 answers

I know this question is a bit old, but with iOS 6, the UIPageViewController has a new transition style property called UIPageViewControllerTransitionStyleScroll , which allows you to use the page controller to use as yours, with simple scrolling between pages, rather than page-jumping in iBooks style.

You should also watch the 2012 WWDC 223 video - Improving User Experience with Scrolling Views , where they mainly go to the old application, which uses the method that you describe for the new UIPageViewController with a scroll style shift.

+6
source

My answer will be that it depends on your goal. If you want to make the application as efficient as possible, I would just use the way it runs in the sample code. I have used it before and I will do it again.

On the other hand, if your goal is to learn about restraining the view controller, how it works and how to use it, this might be a good example to try it out. If you go this way, be sure to check out the WWDC video “Implementing the UIViewController Containment” (https://developer.apple.com/videos/wwdc/2011/).

+2
source

Better iOS5 experience is emerging to stay using the same method as the PageControl example. This is one controller class (pay attention not to the view controller). With child controllers for each page.

At the moment, there is no documented best way to implement paging scrolling using the display controller localization methods included in iOS5.

+2
source

I think the UIPageViewController can go horizontally:

 - (id)initWithTransitionStyle:(UIPageViewControllerTransitionStyle)style navigationOrientation:(UIPageViewControllerNavigationOrientation)navigationOrientation options:(NSDictionary *)options 

and

 enum { UIPageViewControllerNavigationOrientationHorizontal = 0, UIPageViewControllerNavigationOrientationVertical = 1 }; typedef NSInteger UIPageViewControllerNavigationOrientation; 

http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIPageViewControllerClassReferenceClassRef/UIPageViewControllerClassReference.html

-one
source

If you add View Controllers (myViewControllerOne.view) to the UIScrollView — and then create them accordingly for horizontal display — when the user interacts with that view inside the scroll view methods in the view controller, it is called.

By this, I mean that if you have MyViewControllerOne.view as an additional view inside your scroll, when you go to this scroll view page and click the button, the attached method (IBAction, etc.) in MyViewControllerOne will be called.

This should provide you with all the necessary functions, such as adding interface elements, tables, another scroll view, etc. These items will be controlled from their source view controller.

Hope this helps!

-one
source

All Articles