Last active
August 29, 2015 14:05
-
-
Save jonfriskics/61bed2341657f862b5d1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "CSTableViewController.h" | |
@interface CSTableViewController () | |
@end | |
@implementation CSTableViewController | |
- (id)initWithStyle:(UITableViewStyle)style | |
{ | |
self = [super initWithStyle:style]; | |
if (self) { | |
// Custom initialization | |
} | |
return self; | |
} | |
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
NSLog(@"%s",__PRETTY_FUNCTION__); | |
[self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"]; | |
} | |
#pragma mark - Table view data source | |
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView | |
{ | |
return 1; | |
} | |
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section | |
{ | |
return 10; | |
} | |
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | |
{ | |
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath]; | |
cell.textLabel.text = @"hello"; | |
return cell; | |
} | |
- (void)viewWillAppear:(BOOL)animated | |
{ | |
[super viewWillAppear:animated]; | |
NSLog(@"%s",__PRETTY_FUNCTION__); | |
} | |
- (void)viewDidAppear:(BOOL)animated | |
{ | |
[super viewDidAppear:animated]; | |
} | |
- (void)viewDidLayoutSubviews | |
{ | |
[super viewDidLayoutSubviews]; | |
NSLog(@"%s",__PRETTY_FUNCTION__); | |
[self customizeTableViewAppearance]; | |
} | |
- (void)customizeTableViewAppearance | |
{ | |
self.tableView.contentInset = UIEdgeInsetsMake(20, 0, 0, 0); | |
if([UIScreen mainScreen].bounds.size.height == 568) { | |
[self.tableView setFrame:CGRectMake(0, 150, 320, 300)]; | |
} else { | |
[self.tableView setFrame:CGRectMake(0, 150, 320, 200)]; | |
} | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment