@@ -29,70 +29,70 @@ @interface FIRSamplesViewController ()
29
29
@implementation FIRSamplesViewController
30
30
31
31
- (void )viewDidLoad {
32
- [super viewDidLoad ];
32
+ [super viewDidLoad ];
33
33
34
- self.navigationController .navigationBar .topItem .title = self.title ;
35
- self.clearsSelectionOnViewWillAppear = NO ;
34
+ self.navigationController .navigationBar .topItem .title = self.title ;
35
+ self.clearsSelectionOnViewWillAppear = NO ;
36
36
37
- [self populateSamples ];
37
+ [self populateSamples ];
38
38
}
39
39
40
40
- (void )populateSamples {
41
- NSMutableArray *samples = [[NSMutableArray alloc ] init ];
42
-
43
- [samples addObject: [FIRSample sampleWithTitle: @" Auth"
44
- sampleDescription: @" Demonstrates the FirebaseAuthUI flow with customization options"
45
- controller: ^UIViewController *{
46
- UIViewController *controller =
47
- [[UIStoryboard storyboardWithName: @" Main"
48
- bundle: NULL ] instantiateViewControllerWithIdentifier: @" FIRAuthViewController" ];
49
- return controller;
50
- }]];
51
-
52
- [samples addObject: [FIRSample sampleWithTitle: @" Chat"
53
- sampleDescription: @" Demonstrates using a FirebaseCollectionViewDataSource to load data from Firebase Database into a UICollectionView for a basic chat app."
54
- controller: ^UIViewController *{
55
- UIViewController *controller =
56
- [[UIStoryboard storyboardWithName: @" Main"
57
- bundle: NULL ] instantiateViewControllerWithIdentifier: @" ViewController" ];
58
- return controller;
59
- }]];
60
-
61
-
62
- _samplesContainer = samples;
41
+ NSMutableArray *samples = [[NSMutableArray alloc ] init ];
42
+
43
+ [samples addObject: [FIRSample sampleWithTitle: @" Auth"
44
+ sampleDescription: @" Demonstrates the FirebaseAuthUI flow with customization options"
45
+ controller: ^UIViewController *{
46
+ UIViewController *controller =
47
+ [[UIStoryboard storyboardWithName: @" Main"
48
+ bundle: NULL ] instantiateViewControllerWithIdentifier: @" FIRAuthViewController" ];
49
+ return controller;
50
+ }]];
51
+
52
+ [samples addObject: [FIRSample sampleWithTitle: @" Chat"
53
+ sampleDescription: @" Demonstrates using a FirebaseCollectionViewDataSource to load data from Firebase Database into a UICollectionView for a basic chat app."
54
+ controller: ^UIViewController *{
55
+ UIViewController *controller =
56
+ [[UIStoryboard storyboardWithName: @" Main"
57
+ bundle: NULL ] instantiateViewControllerWithIdentifier: @" ViewController" ];
58
+ return controller;
59
+ }]];
60
+
61
+
62
+ _samplesContainer = samples;
63
63
}
64
64
65
65
- (void )didReceiveMemoryWarning {
66
- [super didReceiveMemoryWarning ];
66
+ [super didReceiveMemoryWarning ];
67
67
}
68
68
69
69
#pragma mark - Table view data source
70
70
71
71
- (NSInteger )numberOfSectionsInTableView : (UITableView *)tableView {
72
- return 1 ;
72
+ return 1 ;
73
73
}
74
74
75
75
- (NSInteger )tableView : (UITableView *)tableView numberOfRowsInSection : (NSInteger )section {
76
- return _samplesContainer.count ;
76
+ return _samplesContainer.count ;
77
77
}
78
78
79
79
- (UITableViewCell *)tableView : (UITableView *)tableView cellForRowAtIndexPath : (NSIndexPath *)indexPath {
80
- static NSString *cellId = @" FIRSampleCell" ;
81
- UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier: cellId forIndexPath: indexPath];
80
+ static NSString *cellId = @" FIRSampleCell" ;
81
+ UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier: cellId forIndexPath: indexPath];
82
82
83
- FIRSample *sample = _samplesContainer[indexPath.row];
84
- cell.textLabel .text = sample.title ;
85
- cell.detailTextLabel .text = sample.sampleDescription ;
83
+ FIRSample *sample = _samplesContainer[indexPath.row];
84
+ cell.textLabel .text = sample.title ;
85
+ cell.detailTextLabel .text = sample.sampleDescription ;
86
86
87
-
88
- return cell;
87
+
88
+ return cell;
89
89
}
90
90
91
91
- (void )tableView : (UITableView *)tableView didSelectRowAtIndexPath : (NSIndexPath *)indexPath {
92
- FIRSample *sample = _samplesContainer[indexPath.row];
93
- UIViewController *viewController = sample.controllerBlock ();
94
-
95
- [self .navigationController pushViewController: viewController animated: YES ];
92
+ FIRSample *sample = _samplesContainer[indexPath.row];
93
+ UIViewController *viewController = sample.controllerBlock ();
94
+
95
+ [self .navigationController pushViewController: viewController animated: YES ];
96
96
}
97
97
98
98
@end
0 commit comments