From ce630eef61d4acd8f5c4e1d6a3a60780c5ec4af3 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 18 Dec 2013 05:53:29 +0400 Subject: cleanup and ios6 fixes --- Juick/RevealPanelViewController.m | 53 +++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 21 deletions(-) (limited to 'Juick/RevealPanelViewController.m') diff --git a/Juick/RevealPanelViewController.m b/Juick/RevealPanelViewController.m index ecac5df..a9c71e8 100644 --- a/Juick/RevealPanelViewController.m +++ b/Juick/RevealPanelViewController.m @@ -11,8 +11,13 @@ #import "RevealPanelViewController.h" #import "MessagesViewController.h" -#import "ColorsAndButtons.h" +#import "ColorScheme.h" #import "NSURL+PathParameters.h" +#import "NavCell.h" + + + +static NSString *CellIdentifier = @"NavCell"; @interface RevealPanelViewController () @@ -32,11 +37,15 @@ - (void)viewDidLoad { [super viewDidLoad]; - [self.navigationController.navigationBar.topItem - setTitleView:[[UIImageView alloc] initWithImage:[ColorsAndButtons logo]]]; - [self.view setBackgroundColor:[ColorsAndButtons navbarBackground]]; + self.title = @"Juick"; + + if (NSFoundationVersionNumber <= NSFoundationVersionNumber_iOS_6_1) { + self.navigationController.navigationBar.tintColor = [ColorScheme navbarBackground]; + } + [self.view setBackgroundColor:[ColorScheme navbarBackground]]; self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; self.tableView.separatorColor =[UIColor blackColor]; + [self.tableView registerClass:[NavCell class] forCellReuseIdentifier:CellIdentifier]; } - (void)didReceiveMemoryWarning @@ -55,30 +64,32 @@ } - (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - static NSString *cellIdentifier = @"MenuCell"; - UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; + NavCell * cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; NSInteger row = indexPath.row; - if (cell == nil) { - cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:cellIdentifier]; - [cell setBackgroundColor:[ColorsAndButtons navbarBackground]]; - cell.textLabel.font = [UIFont fontWithName:kFontAwesomeFamilyName size:20.f]; - cell.textLabel.textColor = [ColorsAndButtons navbarFont]; - cell.detailTextLabel.textColor = [ColorsAndButtons navbarFont]; - } + [cell.contentView setBackgroundColor:[ColorScheme navbarBackground]]; + cell.iconLabel.font = [UIFont fontWithName:kFontAwesomeFamilyName size:32.f]; + cell.iconLabel.textColor = [ColorScheme navbarFont]; + cell.iconLabel.backgroundColor = [ColorScheme navbarBackground]; + cell.descriptionTextLabel.backgroundColor = [ColorScheme navbarBackground]; + cell.descriptionTextLabel.textColor = [ColorScheme navbarFont]; if (row == 0) { - cell.detailTextLabel.text = @"My feed"; - cell.textLabel.text = [NSString fontAwesomeIconStringForEnum:FAIconHome]; + cell.descriptionTextLabel.text = @"My feed"; + cell.iconLabel.text = [NSString fontAwesomeIconStringForEnum:FAIconHome]; } else if (row == 1) { - cell.detailTextLabel.text = @"Popular"; - cell.textLabel.text = [NSString fontAwesomeIconStringForEnum:FAIconComments]; + cell.descriptionTextLabel.text = @"Popular"; + cell.iconLabel.text = [NSString fontAwesomeIconStringForEnum:FAIconComments]; } else if (row == 2) { - cell.detailTextLabel.text = @"Discover"; - cell.textLabel.text = [NSString fontAwesomeIconStringForEnum:FAIconSearch]; + cell.descriptionTextLabel.text = @"Discover"; + cell.iconLabel.text = [NSString fontAwesomeIconStringForEnum:FAIconSearch]; } else if (row == 3) { - cell.detailTextLabel.text = @"Images"; - cell.textLabel.text = [NSString fontAwesomeIconStringForEnum:FAIconPicture]; + cell.descriptionTextLabel.text = @"Images"; + cell.iconLabel.text = [NSString fontAwesomeIconStringForEnum:FAIconPicture]; } + [cell setNeedsUpdateConstraints]; + [cell updateConstraintsIfNeeded]; + [cell.contentView setNeedsLayout]; + [cell.contentView layoutIfNeeded]; return cell; } -- cgit v1.2.3