From e32c85b7650c0869a2aa319111a837ede75669d1 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 14 Aug 2016 02:55:21 +0300 Subject: new navcell layout --- Juick.xcodeproj/project.pbxproj | 28 ++++++++------------- Juick/AppDelegate.h | 1 - Juick/Juick-Prefix.pch | 1 - Juick/NavCell.h | 16 ------------ Juick/NavCell.m | 43 --------------------------------- Juick/RevealPanelViewController.h | 2 -- Juick/RevealPanelViewController.m | 30 +++++++++++------------ Juick/TitleView.h | 19 --------------- Juick/TitleView.m | 37 ---------------------------- Juick/UILabel+Utils.h | 15 ------------ Juick/UILabel+Utils.m | 16 ------------ Juick/Views/NavCell.h | 14 +++++++++++ Juick/Views/NavCell.m | 24 ++++++++++++++++++ Juick/Views/NavCell.xib | 51 +++++++++++++++++++++++++++++++++++++++ 14 files changed, 113 insertions(+), 184 deletions(-) delete mode 100644 Juick/NavCell.h delete mode 100644 Juick/NavCell.m delete mode 100644 Juick/TitleView.h delete mode 100644 Juick/TitleView.m delete mode 100644 Juick/UILabel+Utils.h delete mode 100644 Juick/UILabel+Utils.m create mode 100644 Juick/Views/NavCell.h create mode 100644 Juick/Views/NavCell.m create mode 100644 Juick/Views/NavCell.xib diff --git a/Juick.xcodeproj/project.pbxproj b/Juick.xcodeproj/project.pbxproj index f55c8c8..443bcc3 100644 --- a/Juick.xcodeproj/project.pbxproj +++ b/Juick.xcodeproj/project.pbxproj @@ -9,7 +9,6 @@ /* Begin PBXBuildFile section */ 531B2334937B7BA2C56BC426 /* libPods-JuickTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0229858EB2CC685108B19E93 /* libPods-JuickTests.a */; }; 562874C89BA436112F69D3B8 /* libPods-Juick.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 366F932A3613909CFC3ADC81 /* libPods-Juick.a */; }; - 771E4AD618606AA400EBACC8 /* NavCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 771E4AD518606AA400EBACC8 /* NavCell.m */; }; 77317BAC181BBE8500D60005 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 77317BAB181BBE8500D60005 /* Foundation.framework */; }; 77317BAE181BBE8500D60005 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 77317BAD181BBE8500D60005 /* CoreGraphics.framework */; }; 77317BB0181BBE8500D60005 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 77317BAF181BBE8500D60005 /* UIKit.framework */; }; @@ -34,9 +33,7 @@ 77A0954A181F1F25002BDECD /* Message.m in Sources */ = {isa = PBXBuildFile; fileRef = 77A09549181F1F25002BDECD /* Message.m */; }; 77A5BDB0189AEB28000F8D9E /* 0.png in Resources */ = {isa = PBXBuildFile; fileRef = 77A5BDAF189AEB28000F8D9E /* 0.png */; }; 77B09994189D0B9900A84F59 /* UIImage+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 77B09993189D0B9900A84F59 /* UIImage+Utils.m */; }; - 77B099A3189D516800A84F59 /* UILabel+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 77B099A2189D516800A84F59 /* UILabel+Utils.m */; }; 77B099A6189D57F000A84F59 /* User.m in Sources */ = {isa = PBXBuildFile; fileRef = 77B099A5189D57F000A84F59 /* User.m */; }; - 77B099A9189D61BB00A84F59 /* TitleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 77B099A8189D61BB00A84F59 /* TitleView.m */; }; 77C67EDE182827DB00427098 /* reveal-icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 77C67EDC182827DB00427098 /* reveal-icon.png */; }; 77C67EDF182827DB00427098 /* reveal-icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 77C67EDD182827DB00427098 /* reveal-icon@2x.png */; }; 77C67EE21828288C00427098 /* RevealPanelViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 77C67EE11828288C00427098 /* RevealPanelViewController.m */; }; @@ -47,6 +44,8 @@ 77E35A82189A5B5A00B2D216 /* LoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 77E35A81189A5B5A00B2D216 /* LoginViewController.m */; }; 77FFC0191D5FD186003BD81A /* MessageCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 77FFC0171D5FD186003BD81A /* MessageCell.m */; }; 77FFC01A1D5FD186003BD81A /* MessageCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 77FFC0181D5FD186003BD81A /* MessageCell.xib */; }; + 77FFC01E1D5FE7CE003BD81A /* NavCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 77FFC01C1D5FE7CE003BD81A /* NavCell.m */; }; + 77FFC01F1D5FE7CE003BD81A /* NavCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 77FFC01D1D5FE7CE003BD81A /* NavCell.xib */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -63,8 +62,6 @@ 0229858EB2CC685108B19E93 /* libPods-JuickTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-JuickTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 366F932A3613909CFC3ADC81 /* libPods-Juick.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Juick.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 4A0219982372B305EC484794 /* Pods-JuickTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JuickTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-JuickTests/Pods-JuickTests.release.xcconfig"; sourceTree = ""; }; - 771E4AD418606AA400EBACC8 /* NavCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NavCell.h; sourceTree = ""; }; - 771E4AD518606AA400EBACC8 /* NavCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NavCell.m; sourceTree = ""; }; 77317BA8181BBE8500D60005 /* Juick.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Juick.app; sourceTree = BUILT_PRODUCTS_DIR; }; 77317BAB181BBE8500D60005 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 77317BAD181BBE8500D60005 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; @@ -97,12 +94,8 @@ 77A5BDAF189AEB28000F8D9E /* 0.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 0.png; sourceTree = ""; }; 77B09992189D0B9900A84F59 /* UIImage+Utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+Utils.h"; sourceTree = ""; }; 77B09993189D0B9900A84F59 /* UIImage+Utils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+Utils.m"; sourceTree = ""; }; - 77B099A1189D516800A84F59 /* UILabel+Utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UILabel+Utils.h"; sourceTree = ""; }; - 77B099A2189D516800A84F59 /* UILabel+Utils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UILabel+Utils.m"; sourceTree = ""; }; 77B099A4189D57F000A84F59 /* User.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = User.h; sourceTree = ""; }; 77B099A5189D57F000A84F59 /* User.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = User.m; sourceTree = ""; }; - 77B099A7189D61BB00A84F59 /* TitleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TitleView.h; sourceTree = ""; }; - 77B099A8189D61BB00A84F59 /* TitleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TitleView.m; sourceTree = ""; }; 77C67EDC182827DB00427098 /* reveal-icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "reveal-icon.png"; sourceTree = ""; }; 77C67EDD182827DB00427098 /* reveal-icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "reveal-icon@2x.png"; sourceTree = ""; }; 77C67EE01828288C00427098 /* RevealPanelViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RevealPanelViewController.h; sourceTree = ""; }; @@ -118,6 +111,9 @@ 77FFC0161D5FD186003BD81A /* MessageCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MessageCell.h; path = Views/MessageCell.h; sourceTree = ""; }; 77FFC0171D5FD186003BD81A /* MessageCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MessageCell.m; path = Views/MessageCell.m; sourceTree = ""; }; 77FFC0181D5FD186003BD81A /* MessageCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = MessageCell.xib; path = Views/MessageCell.xib; sourceTree = ""; }; + 77FFC01B1D5FE7CE003BD81A /* NavCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NavCell.h; path = Views/NavCell.h; sourceTree = ""; }; + 77FFC01C1D5FE7CE003BD81A /* NavCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NavCell.m; path = Views/NavCell.m; sourceTree = ""; }; + 77FFC01D1D5FE7CE003BD81A /* NavCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = NavCell.xib; path = Views/NavCell.xib; sourceTree = ""; }; 8F93DB342C85111DFBC86143 /* Pods-Juick.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Juick.release.xcconfig"; path = "Pods/Target Support Files/Pods-Juick/Pods-Juick.release.xcconfig"; sourceTree = ""; }; D5F79ADD6611E9C3C0D56671 /* Pods-JuickTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JuickTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-JuickTests/Pods-JuickTests.debug.xcconfig"; sourceTree = ""; }; F3C23ADDEF1C47900AA28093 /* Pods-Juick.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Juick.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Juick/Pods-Juick.debug.xcconfig"; sourceTree = ""; }; @@ -206,8 +202,6 @@ isa = PBXGroup; children = ( 77FFC0151D5FD13C003BD81A /* Views */, - 77B099A1189D516800A84F59 /* UILabel+Utils.h */, - 77B099A2189D516800A84F59 /* UILabel+Utils.m */, 77A5BDAF189AEB28000F8D9E /* 0.png */, 77418CC0182FBABB004111B7 /* iTunesArtwork@2x */, 77418CBA182F9A78004111B7 /* AttachPlaceholder@2x.png */, @@ -231,16 +225,12 @@ 77C67EE71828379700427098 /* ColorScheme.m */, 77975A1B182B6E9A00410C2B /* NewPostViewController.h */, 77975A1C182B6E9A00410C2B /* NewPostViewController.m */, - 771E4AD418606AA400EBACC8 /* NavCell.h */, - 771E4AD518606AA400EBACC8 /* NavCell.m */, 77E35A80189A5B5A00B2D216 /* LoginViewController.h */, 77E35A81189A5B5A00B2D216 /* LoginViewController.m */, 77B09992189D0B9900A84F59 /* UIImage+Utils.h */, 77B09993189D0B9900A84F59 /* UIImage+Utils.m */, 77B099A4189D57F000A84F59 /* User.h */, 77B099A5189D57F000A84F59 /* User.m */, - 77B099A7189D61BB00A84F59 /* TitleView.h */, - 77B099A8189D61BB00A84F59 /* TitleView.m */, ); path = Juick; sourceTree = ""; @@ -280,6 +270,9 @@ 77FFC0161D5FD186003BD81A /* MessageCell.h */, 77FFC0171D5FD186003BD81A /* MessageCell.m */, 77FFC0181D5FD186003BD81A /* MessageCell.xib */, + 77FFC01B1D5FE7CE003BD81A /* NavCell.h */, + 77FFC01C1D5FE7CE003BD81A /* NavCell.m */, + 77FFC01D1D5FE7CE003BD81A /* NavCell.xib */, ); name = Views; sourceTree = ""; @@ -374,6 +367,7 @@ 77C67EEA18283C8D00427098 /* buttons.png in Resources */, 77A5BDB0189AEB28000F8D9E /* 0.png in Resources */, 77FFC01A1D5FD186003BD81A /* MessageCell.xib in Resources */, + 77FFC01F1D5FE7CE003BD81A /* NavCell.xib in Resources */, 77418CC1182FBABB004111B7 /* iTunesArtwork@2x in Resources */, 77418CBF182FBAB5004111B7 /* iTunesArtwork in Resources */, 77317BB6181BBE8500D60005 /* InfoPlist.strings in Resources */, @@ -494,10 +488,8 @@ 77317BBC181BBE8500D60005 /* AppDelegate.m in Sources */, 77A0954A181F1F25002BDECD /* Message.m in Sources */, 77B09994189D0B9900A84F59 /* UIImage+Utils.m in Sources */, - 771E4AD618606AA400EBACC8 /* NavCell.m in Sources */, - 77B099A3189D516800A84F59 /* UILabel+Utils.m in Sources */, 77317BC2181BBE8500D60005 /* MessagesViewController.m in Sources */, - 77B099A9189D61BB00A84F59 /* TitleView.m in Sources */, + 77FFC01E1D5FE7CE003BD81A /* NavCell.m in Sources */, 77C67EE21828288C00427098 /* RevealPanelViewController.m in Sources */, 77B099A6189D57F000A84F59 /* User.m in Sources */, 77975A1D182B6E9A00410C2B /* NewPostViewController.m in Sources */, diff --git a/Juick/AppDelegate.h b/Juick/AppDelegate.h index 561f7ee..c0a7650 100644 --- a/Juick/AppDelegate.h +++ b/Juick/AppDelegate.h @@ -8,7 +8,6 @@ #import #import "User.h" -#import "TitleView.h" @class SWRevealViewController; diff --git a/Juick/Juick-Prefix.pch b/Juick/Juick-Prefix.pch index a0abcee..bd31eac 100644 --- a/Juick/Juick-Prefix.pch +++ b/Juick/Juick-Prefix.pch @@ -18,7 +18,6 @@ #import #import "NSString+HTML.h" #import "UIImage+Utils.h" - #import "UILabel+Utils.h" #import "NSDate+TimeAgo.h" #import "TTTAttributedLabel.h" #endif diff --git a/Juick/NavCell.h b/Juick/NavCell.h deleted file mode 100644 index e210636..0000000 --- a/Juick/NavCell.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// NavCell.h -// Juick -// -// Created by Vitaly on 17.12.13. -// Copyright (c) 2013 com.juick. All rights reserved. -// - -#import - -#import "UILabel+Utils.h" - -@interface NavCell : UITableViewCell -@property (strong, nonatomic) IBOutlet UILabel *iconLabel; -@property (strong, nonatomic) IBOutlet UILabel *descriptionTextLabel; -@end diff --git a/Juick/NavCell.m b/Juick/NavCell.m deleted file mode 100644 index 8cd460a..0000000 --- a/Juick/NavCell.m +++ /dev/null @@ -1,43 +0,0 @@ -// -// NavCell.m -// Juick -// -// Created by Vitaly on 17.12.13. -// Copyright (c) 2013 com.juick. All rights reserved. -// - -#import "NavCell.h" - -@interface NavCell () - -@property (nonatomic, assign) BOOL didSetupConstraints; - -@end - -@implementation NavCell - -- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier -{ - self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; - if (self) { - self.iconLabel = [[UILabel alloc] initWithFrame:CGRectZero]; - self.descriptionTextLabel = [[UILabel alloc] initWithFrame:CGRectZero]; - self.descriptionTextLabel.numberOfLines = 1; - self.descriptionTextLabel.textAlignment = NSTextAlignmentLeft; - [self.contentView addSubview:self.iconLabel]; - [self.contentView addSubview:self.descriptionTextLabel]; - } - return self; -} - -- (void)layoutSubviews { - [super layoutSubviews]; - - CGRect iconRect = [UILabel sizeForLabel:self.iconLabel width:36.0f]; - self.iconLabel.frame = CGRectMake(10, 10, iconRect.size.width, iconRect.size.height); - float textHeight = [UILabel sizeForLabel:self.descriptionTextLabel width:self.contentView.bounds.size.width].size.height; - self.descriptionTextLabel.frame = CGRectMake(10 + self.iconLabel.frame.size.width + 10, 10 + (iconRect.size.height - textHeight) / 2, - self.contentView.bounds.size.width - self.iconLabel.frame.size.width - 10*3, textHeight); -} - -@end diff --git a/Juick/RevealPanelViewController.h b/Juick/RevealPanelViewController.h index 89f87e9..0300274 100644 --- a/Juick/RevealPanelViewController.h +++ b/Juick/RevealPanelViewController.h @@ -9,11 +9,9 @@ #import #import #import "LoginViewController.h" -#import "TitleView.h" #import @interface RevealPanelViewController : UIViewController @property (nonatomic, strong) IBOutlet UITableView *tableView; @property (nonatomic, strong) IBOutlet UIButton *signButton; -@property(nonatomic, strong) IBOutlet TitleView *titleView; @end diff --git a/Juick/RevealPanelViewController.m b/Juick/RevealPanelViewController.m index fe44509..b79ceff 100644 --- a/Juick/RevealPanelViewController.m +++ b/Juick/RevealPanelViewController.m @@ -50,13 +50,11 @@ static NSString *CellIdentifier = @"NavCell"; [self.tableView setSeparatorInset:UIEdgeInsetsZero]; self.tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine; self.tableView.separatorColor =[UIColor darkGrayColor]; - [self.tableView registerClass:[NavCell class] forCellReuseIdentifier:CellIdentifier]; + [self.tableView registerNib:[UINib nibWithNibName:@"NavCell" bundle:nil] forCellReuseIdentifier:CellIdentifier]; [self.view addSubview:self.tableView]; self.signButton = [[UIButton alloc] init]; [self.signButton addTarget:self action:@selector(signInOut) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:self.signButton]; - self.titleView = [[TitleView alloc] initWithImage:nil title:@"Juick"]; - [self.navigationItem setTitleView:self.titleView]; [self refreshInfo]; } @@ -70,8 +68,8 @@ static NSString *CellIdentifier = @"NavCell"; dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{ [User get:[[PDKeychainBindings sharedKeychainBindings] stringForKey:@"com.juick.username"] callback:^(User *user) { if (user != nil) { - [self.titleView.image setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://i.juick.com/as/%@.png", user.uid]]]; - [self.titleView.title setText:user.uname]; + /*[self.titleView.image setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://i.juick.com/as/%@.png", user.uid]]]; + [self.titleView.title setText:user.uname];*/ } }]; }); @@ -117,24 +115,24 @@ static NSString *CellIdentifier = @"NavCell"; NavCell * cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; NSInteger row = indexPath.row; [cell.contentView setBackgroundColor:[ColorScheme navbarBackground]]; - cell.iconLabel.font = [UIFont fontWithName:kFontAwesomeFamilyName size:32.f]; - cell.iconLabel.textColor = [ColorScheme navbarFont]; + cell.icon.font = [UIFont fontWithName:kFontAwesomeFamilyName size:32.f]; + cell.icon.textColor = [ColorScheme navbarFont]; //cell.iconLabel.backgroundColor = [ColorScheme navbarBackground]; //cell.descriptionTextLabel.backgroundColor = [ColorScheme navbarBackground]; - cell.descriptionTextLabel.textColor = [ColorScheme navbarFont]; + cell.descriptionText.textColor = [ColorScheme navbarFont]; if (row == 0) { - cell.descriptionTextLabel.text = @"My feed"; - cell.iconLabel.text = [NSString fontAwesomeIconStringForEnum:FAIconHome]; + cell.descriptionText.text = @"My feed"; + cell.icon.text = [NSString fontAwesomeIconStringForEnum:FAIconHome]; } else if (row == 1) { - cell.descriptionTextLabel.text = @"Popular"; - cell.iconLabel.text = [NSString fontAwesomeIconStringForEnum:FAIconComments]; + cell.descriptionText.text = @"Popular"; + cell.icon.text = [NSString fontAwesomeIconStringForEnum:FAIconComments]; } else if (row == 2) { - cell.descriptionTextLabel.text = @"Discover"; - cell.iconLabel.text = [NSString fontAwesomeIconStringForEnum:FAIconSearch]; + cell.descriptionText.text = @"Discover"; + cell.icon.text = [NSString fontAwesomeIconStringForEnum:FAIconSearch]; } else if (row == 3) { - cell.descriptionTextLabel.text = @"Images"; - cell.iconLabel.text = [NSString fontAwesomeIconStringForEnum:FAIconPicture]; + cell.descriptionText.text = @"Images"; + cell.icon.text = [NSString fontAwesomeIconStringForEnum:FAIconPicture]; } UIView *bgColorView = [[UIView alloc] init]; bgColorView.backgroundColor = [UIColor blackColor]; diff --git a/Juick/TitleView.h b/Juick/TitleView.h deleted file mode 100644 index 17288ef..0000000 --- a/Juick/TitleView.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// TitleView.h -// Juick -// -// Created by Vitaly on 01.02.14. -// Copyright (c) 2014 com.juick. All rights reserved. -// - -#import -#import "UILabel+Utils.h" -#import "ColorScheme.h" - -@interface TitleView : UIView -@property (nonatomic, strong) IBOutlet UIImageView *image; -@property (nonatomic, strong) IBOutlet UILabel *title; - --(id) initWithImage:(UIImage *) image title:(NSString *)title; - -@end diff --git a/Juick/TitleView.m b/Juick/TitleView.m deleted file mode 100644 index 3948041..0000000 --- a/Juick/TitleView.m +++ /dev/null @@ -1,37 +0,0 @@ -// -// TitleView.m -// Juick -// -// Created by Vitaly on 01.02.14. -// Copyright (c) 2014 com.juick. All rights reserved. -// - -#import "TitleView.h" - -@implementation TitleView - --(id) initWithImage:(UIImage *)image title:(NSString *)title { - self = [super initWithFrame:CGRectMake(0, 0, 300.0f, 52.0f)]; - if (self) { - self.image = [[UIImageView alloc] init]; - self.image.image = image; - self.title = [[UILabel alloc] init]; - self.title.numberOfLines = 1; - self.title.textAlignment = NSTextAlignmentLeft; - self.title.text = title; - self.title.textColor = [ColorScheme navbarFont]; - [self addSubview:self.image]; - [self addSubview:self.title]; - } - return self; -} - --(void) layoutSubviews { - [super layoutSubviews]; - self.image.frame = CGRectMake(10, 10, 32, 32); - float textHeight = [UILabel sizeForLabel:self.title width:320.0f].size.height; - self.title.frame = CGRectMake(10 + 32 + 10, 10 + (32 - textHeight) / 2, - self.bounds.size.width - 32 - 10*3, textHeight); -} - -@end diff --git a/Juick/UILabel+Utils.h b/Juick/UILabel+Utils.h deleted file mode 100644 index 2e9cbb6..0000000 --- a/Juick/UILabel+Utils.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// UILabel+Utils.h -// Juick -// -// Created by Vitaly on 01.02.14. -// Copyright (c) 2014 com.juick. All rights reserved. -// - -#import - -@interface UILabel (Utils) - -+ (CGRect) sizeForLabel:(UILabel *)label width:(CGFloat)width; - -@end diff --git a/Juick/UILabel+Utils.m b/Juick/UILabel+Utils.m deleted file mode 100644 index 91136d0..0000000 --- a/Juick/UILabel+Utils.m +++ /dev/null @@ -1,16 +0,0 @@ -// -// UILabel+Utils.m -// Juick -// -// Created by Vitaly on 01.02.14. -// Copyright (c) 2014 com.juick. All rights reserved. -// - -#import "UILabel+Utils.h" - -@implementation UILabel (Utils) - -+ (CGRect) sizeForLabel:(UILabel *)label width:(CGFloat)width { - return [label.text boundingRectWithSize:(CGSize) {width, CGFLOAT_MAX} options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:label.font} context:nil]; -} -@end diff --git a/Juick/Views/NavCell.h b/Juick/Views/NavCell.h new file mode 100644 index 0000000..c8c2b41 --- /dev/null +++ b/Juick/Views/NavCell.h @@ -0,0 +1,14 @@ +// +// NavCell.h +// Juick +// +// Created by Vitaly Takmazov on 14/08/16. +// Copyright © 2016 com.juick. All rights reserved. +// + +#import + +@interface NavCell : UITableViewCell +@property (weak, nonatomic) IBOutlet UILabel *icon; +@property (weak, nonatomic) IBOutlet UILabel *descriptionText; +@end diff --git a/Juick/Views/NavCell.m b/Juick/Views/NavCell.m new file mode 100644 index 0000000..f2ab9f1 --- /dev/null +++ b/Juick/Views/NavCell.m @@ -0,0 +1,24 @@ +// +// NavCell.m +// Juick +// +// Created by Vitaly Takmazov on 14/08/16. +// Copyright © 2016 com.juick. All rights reserved. +// + +#import "NavCell.h" + +@implementation NavCell + +- (void)awakeFromNib { + [super awakeFromNib]; + // Initialization code +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +@end diff --git a/Juick/Views/NavCell.xib b/Juick/Views/NavCell.xib new file mode 100644 index 0000000..bf2691d --- /dev/null +++ b/Juick/Views/NavCell.xib @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3