diff options
author | Vitaly Takmazov | 2013-12-18 05:53:29 +0400 |
---|---|---|
committer | Vitaly Takmazov | 2013-12-18 05:53:29 +0400 |
commit | ce630eef61d4acd8f5c4e1d6a3a60780c5ec4af3 (patch) | |
tree | 7b3364a9e343ec728d7e4886c61c89330b096986 /Juick/MessagesViewController.m | |
parent | a4d2e426a36111a2da3683025ab129ef701d5a3f (diff) |
cleanup and ios6 fixes
Diffstat (limited to 'Juick/MessagesViewController.m')
-rw-r--r-- | Juick/MessagesViewController.m | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/Juick/MessagesViewController.m b/Juick/MessagesViewController.m index 4361148..b77901b 100644 --- a/Juick/MessagesViewController.m +++ b/Juick/MessagesViewController.m @@ -12,7 +12,7 @@ #import "MessageCell.h" #import "Message.h" -#import "ColorsAndButtons.h" +#import "ColorScheme.h" #import "NewPostViewController.h" @@ -80,14 +80,20 @@ static NSString *CellIdentifier = @"MessageCell"; { [super viewDidLoad]; self.dataLoading = NO; - [self.view setBackgroundColor:[ColorsAndButtons mainBackground]]; + [self.view setBackgroundColor:[ColorScheme mainBackground]]; self.messages = [NSMutableArray array]; UIRefreshControl *refresh = [[UIRefreshControl alloc] init]; [refresh addTarget:self action:@selector(refreshData:) forControlEvents:UIControlEventValueChanged]; self.refreshControl = refresh; - - //UINib *cellNib = [UINib nibWithNibName:@"MessageCell" bundle:nil]; - //[self.tableView registerNib:cellNib forCellReuseIdentifier:@"MessageCell"]; + SWRevealViewController *revealController = [self revealViewController]; + if (revealController) { + // TODO: add to thread view too + [self.view addGestureRecognizer:[revealController panGestureRecognizer]]; + } + if (NSFoundationVersionNumber <= NSFoundationVersionNumber_iOS_6_1) { + self.navigationController.navigationBar.tintColor = [ColorScheme navbarBackground]; + } + [self.tableView registerClass:[MessageCell class] forCellReuseIdentifier:CellIdentifier]; } @@ -142,14 +148,10 @@ static NSString *CellIdentifier = @"MessageCell"; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - MessageCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; + MessageCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; [cell updateFonts]; Message *msg = [_messages objectAtIndex:indexPath.row]; [cell bind:msg]; - [cell setNeedsUpdateConstraints]; - [cell updateConstraintsIfNeeded]; - [cell.contentView setNeedsLayout]; - [cell.contentView layoutIfNeeded]; cell.bodyLabel.preferredMaxLayoutWidth = CGRectGetWidth(cell.bodyLabel.frame); [cell.contentView layoutIfNeeded]; @@ -166,12 +168,6 @@ static NSString *CellIdentifier = @"MessageCell"; [cell bind:msg]; - [cell setNeedsUpdateConstraints]; - [cell updateConstraintsIfNeeded]; - - [cell.contentView setNeedsLayout]; - [cell.contentView layoutIfNeeded]; - cell.bodyLabel.preferredMaxLayoutWidth = CGRectGetWidth(cell.bodyLabel.frame); [cell.contentView layoutIfNeeded]; @@ -182,9 +178,9 @@ static NSString *CellIdentifier = @"MessageCell"; - (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath { - if (self.dataLoading) { + /* if (self.dataLoading) { return [self tableView:tableView heightForRowAtIndexPath:indexPath]; - } + }*/ return 500.0f; } |