From 6499148cb3f62e20534b62c181125ebeacfa3438 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 27 Sep 2017 22:24:38 +0300 Subject: cleanup --- Juick/Views/MessageCell.h | 8 +++-- Juick/Views/MessageCell.m | 15 ++++---- Juick/Views/MessageCell.xib | 87 --------------------------------------------- Juick/Views/NavCell.h | 14 -------- Juick/Views/NavCell.m | 24 ------------- Juick/Views/NavCell.xib | 51 -------------------------- 6 files changed, 13 insertions(+), 186 deletions(-) delete mode 100644 Juick/Views/MessageCell.xib delete mode 100644 Juick/Views/NavCell.h delete mode 100644 Juick/Views/NavCell.m delete mode 100644 Juick/Views/NavCell.xib (limited to 'Juick/Views') diff --git a/Juick/Views/MessageCell.h b/Juick/Views/MessageCell.h index 394757b..124ed83 100644 --- a/Juick/Views/MessageCell.h +++ b/Juick/Views/MessageCell.h @@ -7,15 +7,19 @@ // #import +@import TTTAttributedLabel; +@import TagListView_ObjC; #import "Message.h" @interface MessageCell : UITableViewCell +@property (weak, nonatomic) IBOutlet UIImageView *avatar; +@property (weak, nonatomic) IBOutlet UILabel *timestamp; @property (weak, nonatomic) IBOutlet UILabel *title; -@property (weak, nonatomic) IBOutlet UILabel *timestamp; -@property (weak, nonatomic) IBOutlet UIImageView *avatar; +@property (weak, nonatomic) IBOutlet TagListView *tags; @property (weak, nonatomic) IBOutlet TTTAttributedLabel *text; @property (weak, nonatomic) IBOutlet UIImageView *attach; @property (weak, nonatomic) IBOutlet UILabel *summary; + @property (strong, nonatomic) Message * message; @end diff --git a/Juick/Views/MessageCell.m b/Juick/Views/MessageCell.m index 2aae74b..cc35446 100644 --- a/Juick/Views/MessageCell.m +++ b/Juick/Views/MessageCell.m @@ -7,6 +7,9 @@ // #import "MessageCell.h" +@import YYWebImage; +@import DateTools; +@import MWFeedParser; #import "ColorScheme.h" @implementation MessageCell @@ -19,12 +22,6 @@ (id)kCTUnderlineStyleAttributeName : [NSNumber numberWithInt:NSUnderlineStyleSingle] }; } -- (void)setSelected:(BOOL)selected animated:(BOOL)animated { - [super setSelected:selected animated:animated]; - - // Configure the view for the selected state -} - - (void) setMessage:(Message *)msg { _message = msg; self.avatar.yy_imageURL = [NSURL URLWithString:[NSString stringWithFormat:@"https://i.juick.com/a/%d.png", [msg.user.uid intValue]]]; @@ -45,9 +42,11 @@ self.summary.text = nil; } self.text.text = [msg.text stringByDecodingHTMLEntities]; + [self.tags removeAllTags]; if ([msg.tags count] > 0) { - self.text.text = [[NSString alloc] initWithFormat:@"%@\n%@", [msg.tags componentsJoinedByString:@", "], - [msg.text stringByDecodingHTMLEntities]]; + [msg.tags enumerateObjectsUsingBlock:^(NSString * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + [self.tags addTag:obj]; + }]; } } diff --git a/Juick/Views/MessageCell.xib b/Juick/Views/MessageCell.xib deleted file mode 100644 index e555b60..0000000 --- a/Juick/Views/MessageCell.xib +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Juick/Views/NavCell.h b/Juick/Views/NavCell.h deleted file mode 100644 index c8c2b41..0000000 --- a/Juick/Views/NavCell.h +++ /dev/null @@ -1,14 +0,0 @@ -// -// 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 deleted file mode 100644 index f2ab9f1..0000000 --- a/Juick/Views/NavCell.m +++ /dev/null @@ -1,24 +0,0 @@ -// -// 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 deleted file mode 100644 index bf2691d..0000000 --- a/Juick/Views/NavCell.xib +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- cgit v1.2.3