diff options
author | Vitaly Takmazov | 2017-09-27 22:24:38 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2017-09-27 22:24:38 +0300 |
commit | 6499148cb3f62e20534b62c181125ebeacfa3438 (patch) | |
tree | 3aa289caa409366e70dd1802d67df61903fa992b /Juick/Views | |
parent | 25bc4f1357252dc0aeee70f0a638a4226231d5fb (diff) |
cleanup
Diffstat (limited to 'Juick/Views')
-rw-r--r-- | Juick/Views/MessageCell.h | 8 | ||||
-rw-r--r-- | Juick/Views/MessageCell.m | 15 | ||||
-rw-r--r-- | Juick/Views/MessageCell.xib | 87 | ||||
-rw-r--r-- | Juick/Views/NavCell.h | 14 | ||||
-rw-r--r-- | Juick/Views/NavCell.m | 24 | ||||
-rw-r--r-- | Juick/Views/NavCell.xib | 51 |
6 files changed, 13 insertions, 186 deletions
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 <UIKit/UIKit.h> +@import TTTAttributedLabel; +@import TagListView_ObjC; #import "Message.h" @interface MessageCell : UITableViewCell<TTTAttributedLabelDelegate> +@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 @@ -<?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES"> - <device id="ipad12_9" orientation="portrait"> - <adaptation id="fullscreen"/> - </device> - <dependencies> - <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/> - <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> - </dependencies> - <objects> - <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> - <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> - <tableViewCell contentMode="scaleToFill" horizontalHuggingPriority="1000" verticalHuggingPriority="1000" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" selectionStyle="default" indentationWidth="10" reuseIdentifier="MessageCell" rowHeight="343" id="KGk-i7-Jjw" customClass="MessageCell"> - <rect key="frame" x="0.0" y="0.0" width="592" height="343"/> - <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="592" height="342"/> - <autoresizingMask key="autoresizingMask"/> - <subviews> - <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="top" spacing="12" translatesAutoresizingMaskIntoConstraints="NO" id="rE3-Mc-Kov"> - <rect key="frame" x="12" y="12" width="568" height="318"/> - <subviews> - <stackView opaque="NO" contentMode="scaleToFill" spacing="12" translatesAutoresizingMaskIntoConstraints="NO" id="lkI-Na-bF2"> - <rect key="frame" x="0.0" y="0.0" width="103.5" height="48"/> - <subviews> - <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="kHx-jc-jaD"> - <constraints> - <constraint firstAttribute="width" constant="48" id="LYl-qV-pOl"/> - <constraint firstAttribute="height" constant="48" id="ebd-hi-9gJ"/> - </constraints> - </imageView> - <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="6" translatesAutoresizingMaskIntoConstraints="NO" id="ttr-pF-8Zm"> - <rect key="frame" x="60" y="0.0" width="43.5" height="48"/> - <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="zVa-uf-1Mb"> - <rect key="frame" x="0.0" y="0.0" width="43.5" height="26"/> - <fontDescription key="fontDescription" style="UICTFontTextStyleHeadline"/> - <color key="textColor" red="0.0" green="0.40000000000000002" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> - <nil key="highlightedColor"/> - </label> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="252" horizontalCompressionResistancePriority="751" verticalCompressionResistancePriority="751" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5IY-8Y-0W9"> - <rect key="frame" x="0.0" y="32" width="43.5" height="16"/> - <fontDescription key="fontDescription" style="UICTFontTextStyleFootnote"/> - <color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> - <nil key="highlightedColor"/> - </label> - </subviews> - </stackView> - </subviews> - </stackView> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0Q9-qY-nj2" customClass="TTTAttributedLabel"> - <rect key="frame" x="0.0" y="60" width="42" height="0.0"/> - <fontDescription key="fontDescription" style="UICTFontTextStyleBody"/> - <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> - <nil key="highlightedColor"/> - </label> - <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="53j-SC-IXj"> - <rect key="frame" x="0.0" y="72" width="568" height="234"/> - </imageView> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zDd-8E-ic8"> - <fontDescription key="fontDescription" style="UICTFontTextStyleFootnote"/> - <color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> - <nil key="highlightedColor"/> - </label> - </subviews> - </stackView> - </subviews> - <constraints> - <constraint firstAttribute="top" secondItem="rE3-Mc-Kov" secondAttribute="top" constant="-12" id="Qoo-Ft-k2p"/> - <constraint firstItem="rE3-Mc-Kov" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="12" id="f8t-VJ-UHp"/> - <constraint firstAttribute="bottom" secondItem="rE3-Mc-Kov" secondAttribute="bottom" constant="12" id="hcr-Ch-wuN"/> - <constraint firstAttribute="trailing" secondItem="rE3-Mc-Kov" secondAttribute="trailing" constant="12" id="viV-Pm-6in"/> - </constraints> - </tableViewCellContentView> - <connections> - <outlet property="attach" destination="53j-SC-IXj" id="KJm-CX-dUB"/> - <outlet property="avatar" destination="kHx-jc-jaD" id="Fta-hP-KqC"/> - <outlet property="summary" destination="zDd-8E-ic8" id="8LF-Oz-1Co"/> - <outlet property="text" destination="0Q9-qY-nj2" id="M0J-BE-oUq"/> - <outlet property="timestamp" destination="5IY-8Y-0W9" id="HBP-8W-F1a"/> - <outlet property="title" destination="zVa-uf-1Mb" id="uOQ-uv-r33"/> - </connections> - <point key="canvasLocation" x="204" y="424.5"/> - </tableViewCell> - </objects> -</document> 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 <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 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 @@ -<?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> |