forked from WenchaoD/FSCalendar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FSTableViewController.m
57 lines (48 loc) · 1.97 KB
/
FSTableViewController.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//
// FSTableViewController.m
// FSCalendar
//
// Created by DingWenchao on 6/25/15.
// Copyright (c) 2015 =. All rights reserved.
//
#import "FSTableViewController.h"
#import "LoadViewExampleViewController.h"
#import "FullScreenExampleViewController.h"
#import "DelegateAppearanceViewController.h"
#import "HidePlaceholderViewController.h"
#import "ButtonsViewController.h"
#import "DIYExampleViewController.h"
#import "RangePickerViewController.h"
@implementation FSTableViewController
- (void)viewDidLoad
{
[super viewDidLoad];
self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil];
self.viewControllers = @[
[RangePickerViewController class],
[DIYExampleViewController class],
[ButtonsViewController class],
[HidePlaceholderViewController class],
[DelegateAppearanceViewController class],
[FullScreenExampleViewController class],
[NSObject class],
[NSObject class],
[LoadViewExampleViewController class]
];
self.tableView.rowHeight = [[UIDevice currentDevice].model hasSuffix:@"iPad"] ? 60.0 : 44.0;
}
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
if (self.tableView.indexPathForSelectedRow) {
[self.tableView deselectRowAtIndexPath:self.tableView.indexPathForSelectedRow animated:animated];
}
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
id viewControllerClass = self.viewControllers[indexPath.row];
if ([viewControllerClass isSubclassOfClass:[UIViewController class]]) {
[self.navigationController pushViewController:[[viewControllerClass alloc] init] animated:YES];
}
}
@end