1- //
2- // MGZAppDelegate.m
3- // MagazineViewController
4- //
5- // Created by Bartek Chlebek on 09/20/2016.
6- // Copyright (c) 2016 Bartek Chlebek. All rights reserved.
7- //
8-
91#import " MGZAppDelegate.h"
2+ #import " UIViewController+Demo.h"
103@import MagazineViewController;
114
125@interface MGZAppDelegate () <MGZPageViewControllerDataSource>
@@ -45,9 +38,10 @@ - (NSArray *)viewControllers
4538 }
4639
4740 _viewControllers = @[
48- [self newViewControllerWithColor: [UIColor redColor ]],
49- [[UINavigationController alloc ] initWithRootViewController: [UITableViewController new ]],
50- [self newImageViewController ],
41+ [UIViewController viewControllerWithText: @" Page 1" ],
42+ [UIViewController viewControllerWithText: @" Page 2" ],
43+ [UIViewController viewControllerWithText: @" Page 3" ],
44+ [UIViewController viewControllerWithText: @" Page 4" ],
5145 ];
5246
5347 return _viewControllers;
@@ -70,29 +64,4 @@ - (BOOL)shouldDisplayPageIndicator
7064 return YES ;
7165}
7266
73- #pragma mark - Helpers
74-
75- - (UIViewController *)newViewControllerWithColor : (UIColor *)color
76- {
77- UIViewController *vc = [UIViewController new ];
78- vc.view .backgroundColor = [UIColor redColor ];
79- return vc;
80- }
81-
82- - (UIViewController *)newImageViewController
83- {
84- UIViewController *vc = [UIViewController new ];
85-
86- UIImageView *imageView = [[UIImageView alloc ] initWithImage: [UIImage imageNamed: @" img" ]];
87- imageView.frame = vc.view .bounds ;
88- imageView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
89- [vc.view addSubview: imageView];
90-
91- UIView *orangeView = [[UIView alloc ] initWithFrame: CGRectMake (10 , 10 , 50 , 50 )];
92- orangeView.backgroundColor = [UIColor orangeColor ];
93- [vc.view addSubview: orangeView];
94-
95- return vc;
96- }
97-
9867@end
0 commit comments