Yes there is. You must use the UIPageViewController
. The UIPageViewController
has a data source and delegation methods that are invoked depending on whether the user moves left or right. Basically he says: "Hey, give me a UIViewController, which should be displayed before or after this UIViewController."
Here is an example:
MyPageViewController.h
@interface MyPageViewController : UIPageViewController <UIPageViewControllerDataSource, UIPageViewControllerDelegate> @end
MyPageViewController.m
#import "MyPageViewController.h" @implementation MyPageViewController - (id)init { self = [self initWithTransitionStyle:UIPageViewControllerTransitionStyleScroll navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal options:nil]; if (self) { self.dataSource = self; self.delegate = self; self.title = @"Some title"; // set the initial view controller [self setViewControllers:@[[[SomeViewController alloc] init]] direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:NULL]; } return self; }
What is it!
source share