diff options
author | Vitaly Takmazov | 2016-08-14 02:55:21 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-08-14 02:55:21 +0300 |
commit | e32c85b7650c0869a2aa319111a837ede75669d1 (patch) | |
tree | 29dfae230aded06e9d70781a8d393818e0d926f1 | |
parent | 934f816c2e0851ea7faf7c7e5c4a84779a4accfe (diff) |
new navcell layout
-rw-r--r-- | Juick.xcodeproj/project.pbxproj | 28 | ||||
-rw-r--r-- | Juick/AppDelegate.h | 1 | ||||
-rw-r--r-- | Juick/Juick-Prefix.pch | 1 | ||||
-rw-r--r-- | Juick/NavCell.h | 16 | ||||
-rw-r--r-- | Juick/NavCell.m | 43 | ||||
-rw-r--r-- | Juick/RevealPanelViewController.h | 2 | ||||
-rw-r--r-- | Juick/RevealPanelViewController.m | 30 | ||||
-rw-r--r-- | Juick/TitleView.h | 19 | ||||
-rw-r--r-- | Juick/TitleView.m | 37 | ||||
-rw-r--r-- | Juick/UILabel+Utils.h | 15 | ||||
-rw-r--r-- | Juick/UILabel+Utils.m | 16 | ||||
-rw-r--r-- | Juick/Views/NavCell.h | 14 | ||||
-rw-r--r-- | Juick/Views/NavCell.m | 24 | ||||
-rw-r--r-- | Juick/Views/NavCell.xib | 51 |
14 files changed, 113 insertions, 184 deletions
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 = "<group>"; }; - 771E4AD418606AA400EBACC8 /* NavCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NavCell.h; sourceTree = "<group>"; }; - 771E4AD518606AA400EBACC8 /* NavCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NavCell.m; sourceTree = "<group>"; }; 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 = "<group>"; }; 77B09992189D0B9900A84F59 /* UIImage+Utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+Utils.h"; sourceTree = "<group>"; }; 77B09993189D0B9900A84F59 /* UIImage+Utils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+Utils.m"; sourceTree = "<group>"; }; - 77B099A1189D516800A84F59 /* UILabel+Utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UILabel+Utils.h"; sourceTree = "<group>"; }; - 77B099A2189D516800A84F59 /* UILabel+Utils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UILabel+Utils.m"; sourceTree = "<group>"; }; 77B099A4189D57F000A84F59 /* User.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = User.h; sourceTree = "<group>"; }; 77B099A5189D57F000A84F59 /* User.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = User.m; sourceTree = "<group>"; }; - 77B099A7189D61BB00A84F59 /* TitleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TitleView.h; sourceTree = "<group>"; }; - 77B099A8189D61BB00A84F59 /* TitleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TitleView.m; sourceTree = "<group>"; }; 77C67EDC182827DB00427098 /* reveal-icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "reveal-icon.png"; sourceTree = "<group>"; }; 77C67EDD182827DB00427098 /* reveal-icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "reveal-icon@2x.png"; sourceTree = "<group>"; }; 77C67EE01828288C00427098 /* RevealPanelViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RevealPanelViewController.h; sourceTree = "<group>"; }; @@ -118,6 +111,9 @@ 77FFC0161D5FD186003BD81A /* MessageCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MessageCell.h; path = Views/MessageCell.h; sourceTree = "<group>"; }; 77FFC0171D5FD186003BD81A /* MessageCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MessageCell.m; path = Views/MessageCell.m; sourceTree = "<group>"; }; 77FFC0181D5FD186003BD81A /* MessageCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = MessageCell.xib; path = Views/MessageCell.xib; sourceTree = "<group>"; }; + 77FFC01B1D5FE7CE003BD81A /* NavCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NavCell.h; path = Views/NavCell.h; sourceTree = "<group>"; }; + 77FFC01C1D5FE7CE003BD81A /* NavCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NavCell.m; path = Views/NavCell.m; sourceTree = "<group>"; }; + 77FFC01D1D5FE7CE003BD81A /* NavCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = NavCell.xib; path = Views/NavCell.xib; sourceTree = "<group>"; }; 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 = "<group>"; }; 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 = "<group>"; }; 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 = "<group>"; }; @@ -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 = "<group>"; @@ -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 = "<group>"; @@ -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 <UIKit/UIKit.h> #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 <SDWebImage/UIImageView+WebCache.h> #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 <UIKit/UIKit.h> - -#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 <UIKit/UIKit.h> #import <FAImageView.h> #import "LoginViewController.h" -#import "TitleView.h" #import <SDWebImage/UIImageView+WebCache.h> @interface RevealPanelViewController : UIViewController<UITableViewDataSource, UITableViewDelegate> @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 <UIKit/UIKit.h> -#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 <UIKit/UIKit.h> - -@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 <UIKit/UIKit.h> + +@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 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10117" systemVersion="15G31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES"> + <dependencies> + <deployment identifier="iOS"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/> + </dependencies> + <objects> + <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> + <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> + <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="NavCell" id="KGk-i7-Jjw" customClass="NavCell"> + <rect key="frame" x="0.0" y="0.0" width="320" height="44"/> + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> + <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM"> + <rect key="frame" x="0.0" y="0.0" width="320" height="43.5"/> + <autoresizingMask key="autoresizingMask"/> + <subviews> + <stackView opaque="NO" contentMode="scaleToFill" spacing="6" translatesAutoresizingMaskIntoConstraints="NO" id="uyi-Iy-xUe"> + <rect key="frame" x="6" y="6" width="308" height="31"/> + <subviews> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dqo-um-Eh0"> + <rect key="frame" x="0.0" y="0.0" width="36" height="31"/> + <constraints> + <constraint firstAttribute="width" constant="36" id="VF9-mH-twl"/> + </constraints> + <fontDescription key="fontDescription" type="system" pointSize="17"/> + <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> + <nil key="highlightedColor"/> + </label> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="y8z-JG-Wj8"> + <rect key="frame" x="42" y="0.0" width="266" height="31"/> + <fontDescription key="fontDescription" type="system" pointSize="17"/> + <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> + <nil key="highlightedColor"/> + </label> + </subviews> + </stackView> + </subviews> + <constraints> + <constraint firstItem="uyi-Iy-xUe" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="6" id="2ay-nb-uYm"/> + <constraint firstAttribute="bottom" secondItem="uyi-Iy-xUe" secondAttribute="bottom" constant="6.5" id="Ks0-9y-A2A"/> + <constraint firstItem="uyi-Iy-xUe" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="6" id="TsO-i1-64l"/> + <constraint firstAttribute="trailing" secondItem="uyi-Iy-xUe" secondAttribute="trailing" constant="6" id="oNg-pG-xo1"/> + </constraints> + </tableViewCellContentView> + <connections> + <outlet property="descriptionText" destination="y8z-JG-Wj8" id="pKg-iv-fc3"/> + <outlet property="icon" destination="dqo-um-Eh0" id="0Io-ae-z3D"/> + </connections> + </tableViewCell> + </objects> +</document> |