forked from youknowone/UI7Kit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUITPreparedCellTableViewController.m
55 lines (43 loc) · 1.4 KB
/
UITPreparedCellTableViewController.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
//
// UITPreparedCellTableViewController.m
// FoundationExtension
//
// Created by Jeong YunWon on 13. 4. 7..
// Copyright (c) 2013 youknowone.org. All rights reserved.
//
#import "UITPreparedCellTableViewController.h"
@interface UITPreparedCellTableViewController ()
@end
@implementation UITPreparedCellTableViewController
@synthesize tableView=_tableView;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
NSArray *titles = @[@"title1", @"title2", @"title3"];
self.tableView.hasUniqueSection = YES;
self.tableView.cells = [titles arrayByMappingOperatorWithIndex:^id(id obj, NSUInteger index) {
UITableViewCell *cell = [UITableViewCell cellWithStyle:UITableViewCellStyleValue1 reuseIdentifier:nil];
cell.textLabel.text = obj;
cell.detailTextLabel.text = [NSString stringWithInteger:index];
return cell;
}];
assert([self.tableView.cells[0] isKindOfClass:[UITableViewCell class]]);
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark -
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"hi");
}
@end