templateにより、page-based applicationを作成。
ModelController.mに以下追加
[objc]
//
– (NSInteger)presentationCountForPageViewController:(UIPageViewController *)pageViewController
{
return _pageData.count;
}
– (NSInteger)presentationIndexForPageViewController:(UIPageViewController *)pageViewController
{
return 0;
}
//
[/objc]
RootViewController.mを以下一部修正
[objc]
//
self.pageViewController = [[UIPageViewController alloc] initWithTransitionStyle:UIPageViewControllerTransitionStyleScroll navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal options:nil];
//
[/objc]
PageControlの色等変更については、AppDelegate.mに以下追加
[objc]
//
@implementation AppDelegate
– (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
UIPageControl *pageControl = [UIPageControl appearance];
pageControl.pageIndicatorTintColor = [UIColor lightGrayColor];
pageControl.currentPageIndicatorTintColor = [UIColor blackColor];
pageControl.backgroundColor = [UIColor whiteColor];
return YES;
}
//
[/objc]