8
8
9
9
#import " MTZWhatsNewViewController.h"
10
10
11
- #import " MTZWhatsNewFeatureTableViewCell.h"
12
11
#import " MTZTableView.h"
12
+ #import " MTZWhatsNewFeatureTableViewCell.h"
13
+
14
+ #import " MTZCollectionView.h"
15
+ #import " MTZWhatsNewFeatureCollectionViewCell.h"
16
+
13
17
#import " SAMGradientView.h"
14
18
15
- @interface MTZWhatsNewViewController () <UITableViewDelegate, UITableViewDataSource >
19
+ @interface MTZWhatsNewViewController () <UICollectionViewDelegate, UICollectionViewDataSource >
16
20
17
21
// / An ordered list of the versions from newest to oldest.
18
22
@property (strong , nonatomic ) NSArray *orderedKeys;
19
23
20
- // / The table view to display all the new features.
21
- @property (strong , nonatomic ) MTZTableView *tableView ;
24
+ // / The collection view to display all the new features.
25
+ @property (strong , nonatomic ) MTZCollectionView *collectionView ;
22
26
23
27
// / The gradient presented as the background.
24
28
@property (strong , nonatomic ) SAMGradientView *backgroundGradientView;
@@ -67,19 +71,18 @@ - (void)commonInit
67
71
self.backgroundGradientView .gradientColors = @[[UIColor clearColor ], [UIColor clearColor ]];
68
72
self.backgroundGradientView .gradientLocations = @[@0.0 , @1.0 ];
69
73
70
- // Feature table view.
71
- self.tableView = [[MTZTableView alloc ] initWithFrame: self .view.bounds style: UITableViewStylePlain ];
72
- self.tableView .delegate = self;
73
- self.tableView .dataSource = self;
74
- [self .tableView registerClass: [MTZWhatsNewFeatureTableViewCell class ] forCellReuseIdentifier :@" feature" ];
74
+ // Feature collection view.
75
+ self.collectionView = [[MTZCollectionView alloc ] initWithFrame: self .view.bounds collectionViewLayout: <#(UICollectionViewLayout *)#> ];
76
+ self.collectionView .delegate = self;
77
+ self.collectionView .dataSource = self;
78
+ [self .collectionView registerClass: [MTZWhatsNewFeatureCollectionViewCell class ] forCellWithReuseIdentifier :@" feature" ];
75
79
UIEdgeInsets edgeInsets = UIEdgeInsetsMake (0 , 0 , 50 , 0 );
76
- self.tableView .scrollIndicatorInsets = edgeInsets;
77
- self.tableView .contentInset = edgeInsets;
78
- self.tableView .autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
79
- self.tableView .backgroundColor = [UIColor clearColor ];
80
- self.tableView .separatorStyle = UITableViewCellSeparatorStyleNone;
81
- self.tableView .indicatorStyle = UIScrollViewIndicatorStyleWhite;
82
- [self .view addSubview: self .tableView];
80
+ self.collectionView .scrollIndicatorInsets = edgeInsets;
81
+ self.collectionView .contentInset = edgeInsets;
82
+ self.collectionView .autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
83
+ self.collectionView .backgroundColor = [UIColor clearColor ];
84
+ self.collectionView .indicatorStyle = UIScrollViewIndicatorStyleWhite;
85
+ [self .view addSubview: self .collectionView];
83
86
84
87
// Get Started.
85
88
CGRect frame = CGRectMake (0 , self.view .bounds .size .height -50 , self.view .bounds .size .width , 50 );
@@ -99,7 +102,7 @@ - (void)commonInit
99
102
- (void )viewDidAppear : (BOOL )animated
100
103
{
101
104
[super viewDidAppear: animated];
102
- [self .tableView flashScrollIndicators ];
105
+ [self .collectionView flashScrollIndicators ];
103
106
}
104
107
105
108
- (BOOL )prefersStatusBarHidden
@@ -125,8 +128,8 @@ - (void)setFeatures:(NSDictionary *)features
125
128
return [obj2 compare: obj1 options: NSNumericSearch];
126
129
}];
127
130
128
- // Reload the table view's data.
129
- [self .tableView reloadData ];
131
+ // Reload the collection view's data.
132
+ [self .collectionView reloadData ];
130
133
}
131
134
132
135
- (void )setTopColor : (UIColor *)topColor
0 commit comments