From 9036619d1021d78754f1033cfa52645057a6f82d Mon Sep 17 00:00:00 2001 From: Ibrahim Ulukaya Date: Thu, 14 Apr 2016 12:03:53 -0400 Subject: [PATCH 01/23] fix init at STXAttributedLabel.m --- STXDynamicTableView/Labels/STXAttributedLabel.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/STXDynamicTableView/Labels/STXAttributedLabel.m b/STXDynamicTableView/Labels/STXAttributedLabel.m index d1e8f78..4efbb98 100644 --- a/STXDynamicTableView/Labels/STXAttributedLabel.m +++ b/STXDynamicTableView/Labels/STXAttributedLabel.m @@ -15,7 +15,7 @@ @implementation STXAttributedLabel - (instancetype)initForParagraphStyleWithText:(NSString *)text { - self = [super init]; + self = [super initWithFrame:CGRectZero]; if (self) { if ([text stringContainsEmoji]) { UIFont *commentFont = self.font; From 73f07e36b756e7f74070f17148bc5d50b999aef2 Mon Sep 17 00:00:00 2001 From: Ibrahim Ulukaya Date: Thu, 14 Apr 2016 12:10:29 -0400 Subject: [PATCH 02/23] fix STXCaptionCell.h --- STXDynamicTableView/Cells/STXCaptionCell.h | 1 + 1 file changed, 1 insertion(+) diff --git a/STXDynamicTableView/Cells/STXCaptionCell.h b/STXDynamicTableView/Cells/STXCaptionCell.h index a095556..e2199d8 100644 --- a/STXDynamicTableView/Cells/STXCaptionCell.h +++ b/STXDynamicTableView/Cells/STXCaptionCell.h @@ -7,6 +7,7 @@ // @import UIKit; +#import "STXUserItem.h" @class STXCaptionCell; From 6843712728b7a9d9eebc41f4407ab664e0b240dd Mon Sep 17 00:00:00 2001 From: Ibrahim Ulukaya Date: Thu, 14 Apr 2016 12:31:47 -0400 Subject: [PATCH 03/23] fix missing imports --- STXDynamicTableView/Cells/STXCaptionCell.m | 2 ++ STXDynamicTableView/Cells/STXCommentCell.m | 2 ++ 2 files changed, 4 insertions(+) diff --git a/STXDynamicTableView/Cells/STXCaptionCell.m b/STXDynamicTableView/Cells/STXCaptionCell.m index dda27f6..ae8a996 100644 --- a/STXDynamicTableView/Cells/STXCaptionCell.m +++ b/STXDynamicTableView/Cells/STXCaptionCell.m @@ -8,6 +8,8 @@ #import "STXCaptionCell.h" #import "STXAttributedLabel.h" +#import +#import static CGFloat STXCaptionViewLeadingEdgeInset = 10.f; static CGFloat STXCaptionViewTrailingEdgeInset = 10.f; diff --git a/STXDynamicTableView/Cells/STXCommentCell.m b/STXDynamicTableView/Cells/STXCommentCell.m index 069f56a..3b2a40b 100644 --- a/STXDynamicTableView/Cells/STXCommentCell.m +++ b/STXDynamicTableView/Cells/STXCommentCell.m @@ -8,6 +8,8 @@ #import "STXCommentCell.h" #import "STXAttributedLabel.h" +#import +#import static CGFloat STXCommentViewLeadingEdgeInset = 10.f; static CGFloat STXCommentViewTrailingEdgeInset = 10.f; From c0bfbb12781182bea5bddcb15b50717eb8c79ffb Mon Sep 17 00:00:00 2001 From: Ibrahim Ulukaya Date: Thu, 14 Apr 2016 12:31:47 -0400 Subject: [PATCH 04/23] fix missing imports --- STXDynamicTableView/Cells/STXCaptionCell.m | 2 ++ STXDynamicTableView/Cells/STXCommentCell.m | 2 ++ STXDynamicTableView/Cells/STXFeedPhotoCell.m | 2 ++ 3 files changed, 6 insertions(+) diff --git a/STXDynamicTableView/Cells/STXCaptionCell.m b/STXDynamicTableView/Cells/STXCaptionCell.m index dda27f6..ae8a996 100644 --- a/STXDynamicTableView/Cells/STXCaptionCell.m +++ b/STXDynamicTableView/Cells/STXCaptionCell.m @@ -8,6 +8,8 @@ #import "STXCaptionCell.h" #import "STXAttributedLabel.h" +#import +#import static CGFloat STXCaptionViewLeadingEdgeInset = 10.f; static CGFloat STXCaptionViewTrailingEdgeInset = 10.f; diff --git a/STXDynamicTableView/Cells/STXCommentCell.m b/STXDynamicTableView/Cells/STXCommentCell.m index 069f56a..3b2a40b 100644 --- a/STXDynamicTableView/Cells/STXCommentCell.m +++ b/STXDynamicTableView/Cells/STXCommentCell.m @@ -8,6 +8,8 @@ #import "STXCommentCell.h" #import "STXAttributedLabel.h" +#import +#import static CGFloat STXCommentViewLeadingEdgeInset = 10.f; static CGFloat STXCommentViewTrailingEdgeInset = 10.f; diff --git a/STXDynamicTableView/Cells/STXFeedPhotoCell.m b/STXDynamicTableView/Cells/STXFeedPhotoCell.m index 23e2b25..4f3b15d 100644 --- a/STXDynamicTableView/Cells/STXFeedPhotoCell.m +++ b/STXDynamicTableView/Cells/STXFeedPhotoCell.m @@ -9,6 +9,8 @@ #import "STXFeedPhotoCell.h" #import "UIImageView+Masking.h" +#import + @interface STXFeedPhotoCell () From 2e4576c23451de50da35e9740ef2c80a1834450c Mon Sep 17 00:00:00 2001 From: Ibrahim Ulukaya Date: Thu, 14 Apr 2016 12:39:46 -0400 Subject: [PATCH 05/23] fix headers --- STXDynamicTableView/Cells/STXFeedPhotoCell.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/STXDynamicTableView/Cells/STXFeedPhotoCell.m b/STXDynamicTableView/Cells/STXFeedPhotoCell.m index 4f3b15d..3aa6c76 100644 --- a/STXDynamicTableView/Cells/STXFeedPhotoCell.m +++ b/STXDynamicTableView/Cells/STXFeedPhotoCell.m @@ -10,7 +10,7 @@ #import "UIImageView+Masking.h" #import - +#import @interface STXFeedPhotoCell () From 32df0b3ef9940e121d5f3858fedaeeda40bf747b Mon Sep 17 00:00:00 2001 From: Ibrahim Ulukaya Date: Thu, 14 Apr 2016 12:48:50 -0400 Subject: [PATCH 06/23] fix headers --- STXDynamicTableView/Cells/STXLikesCell.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/STXDynamicTableView/Cells/STXLikesCell.m b/STXDynamicTableView/Cells/STXLikesCell.m index 7b574fb..e8126b9 100644 --- a/STXDynamicTableView/Cells/STXLikesCell.m +++ b/STXDynamicTableView/Cells/STXLikesCell.m @@ -7,6 +7,9 @@ // #import "STXLikesCell.h" +#import +#import +#import static CGFloat STXLikesViewLeadingEdgeInset = 10.f; static CGFloat STXLikesViewTrailingEdgeInset = 10.f; From b4d11ca213e3202e4b2c3624902a66ae8e6e3474 Mon Sep 17 00:00:00 2001 From: Ibrahim Ulukaya Date: Thu, 14 Apr 2016 13:16:45 -0400 Subject: [PATCH 07/23] fix headers --- STXDynamicTableView/Cells/STXFeedPhotoCell.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/STXDynamicTableView/Cells/STXFeedPhotoCell.h b/STXDynamicTableView/Cells/STXFeedPhotoCell.h index 227fe60..3d12176 100644 --- a/STXDynamicTableView/Cells/STXFeedPhotoCell.h +++ b/STXDynamicTableView/Cells/STXFeedPhotoCell.h @@ -7,6 +7,8 @@ // @import UIKit; +#import "STXUserItem.h" +#import "STXPostItem.h" @protocol STXFeedPhotoCellDelegate From fd64389f602d29ed62383f6217ca7b0a43ee720c Mon Sep 17 00:00:00 2001 From: Ibrahim Ulukaya Date: Thu, 14 Apr 2016 13:18:35 -0400 Subject: [PATCH 08/23] fix headers --- STXDynamicTableView/Cells/STXCommentCell.m | 1 + 1 file changed, 1 insertion(+) diff --git a/STXDynamicTableView/Cells/STXCommentCell.m b/STXDynamicTableView/Cells/STXCommentCell.m index 3b2a40b..99c9698 100644 --- a/STXDynamicTableView/Cells/STXCommentCell.m +++ b/STXDynamicTableView/Cells/STXCommentCell.m @@ -7,6 +7,7 @@ // #import "STXCommentCell.h" +#import "STXUserItem.h" #import "STXAttributedLabel.h" #import #import From c6514b5f68d1e1c5741e4e03cb06dc1906a925a6 Mon Sep 17 00:00:00 2001 From: Ibrahim Ulukaya Date: Thu, 14 Apr 2016 13:21:54 -0400 Subject: [PATCH 09/23] fix headers --- STXDynamicTableView/Cells/STXCommentCell.h | 1 + STXDynamicTableView/Cells/STXCommentCell.m | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/STXDynamicTableView/Cells/STXCommentCell.h b/STXDynamicTableView/Cells/STXCommentCell.h index b93787c..d5a3fd4 100644 --- a/STXDynamicTableView/Cells/STXCommentCell.h +++ b/STXDynamicTableView/Cells/STXCommentCell.h @@ -7,6 +7,7 @@ // @import UIKit; +#import "STXCommentItem.h" typedef NS_ENUM(int16_t, STXCommentCellStyle) { STXCommentCellStyleSingleComment, diff --git a/STXDynamicTableView/Cells/STXCommentCell.m b/STXDynamicTableView/Cells/STXCommentCell.m index 99c9698..3af4d51 100644 --- a/STXDynamicTableView/Cells/STXCommentCell.m +++ b/STXDynamicTableView/Cells/STXCommentCell.m @@ -7,8 +7,8 @@ // #import "STXCommentCell.h" -#import "STXUserItem.h" #import "STXAttributedLabel.h" +#import "FPUserItem.h" #import #import From 7b3a970b47ba100458d6a7082d8ce13b2e91523c Mon Sep 17 00:00:00 2001 From: Ibrahim Ulukaya Date: Thu, 14 Apr 2016 13:21:54 -0400 Subject: [PATCH 10/23] fix headers --- STXDynamicTableView/Cells/STXCommentCell.h | 1 + STXDynamicTableView/Cells/STXCommentCell.m | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/STXDynamicTableView/Cells/STXCommentCell.h b/STXDynamicTableView/Cells/STXCommentCell.h index b93787c..d5a3fd4 100644 --- a/STXDynamicTableView/Cells/STXCommentCell.h +++ b/STXDynamicTableView/Cells/STXCommentCell.h @@ -7,6 +7,7 @@ // @import UIKit; +#import "STXCommentItem.h" typedef NS_ENUM(int16_t, STXCommentCellStyle) { STXCommentCellStyleSingleComment, diff --git a/STXDynamicTableView/Cells/STXCommentCell.m b/STXDynamicTableView/Cells/STXCommentCell.m index 99c9698..8858a65 100644 --- a/STXDynamicTableView/Cells/STXCommentCell.m +++ b/STXDynamicTableView/Cells/STXCommentCell.m @@ -7,8 +7,8 @@ // #import "STXCommentCell.h" -#import "STXUserItem.h" #import "STXAttributedLabel.h" +#import "STXUserItem.h" #import #import From 11d34d683c3d0a8b36a7001f8c73786cb31819c4 Mon Sep 17 00:00:00 2001 From: Ibrahim Ulukaya Date: Thu, 14 Apr 2016 13:25:53 -0400 Subject: [PATCH 11/23] fix headers --- STXDynamicTableView/Cells/STXUserActionCell.h | 1 + 1 file changed, 1 insertion(+) diff --git a/STXDynamicTableView/Cells/STXUserActionCell.h b/STXDynamicTableView/Cells/STXUserActionCell.h index a9c080d..7c4c66b 100644 --- a/STXDynamicTableView/Cells/STXUserActionCell.h +++ b/STXDynamicTableView/Cells/STXUserActionCell.h @@ -7,6 +7,7 @@ // @import UIKit; +#import "STXPostItem.h" @class STXUserActionCell; From b37fe06aa55d05ec4fc8d1b88c6535d7e587edf2 Mon Sep 17 00:00:00 2001 From: Ibrahim Ulukaya Date: Thu, 14 Apr 2016 13:28:43 -0400 Subject: [PATCH 12/23] fix headers --- STXDynamicTableView/Labels/STXAttributedLabel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/STXDynamicTableView/Labels/STXAttributedLabel.h b/STXDynamicTableView/Labels/STXAttributedLabel.h index 738073e..944232f 100644 --- a/STXDynamicTableView/Labels/STXAttributedLabel.h +++ b/STXDynamicTableView/Labels/STXAttributedLabel.h @@ -6,7 +6,7 @@ // Copyright (c) 2014 2359 Media. All rights reserved. // -#import "TTTAttributedLabel.h" +#import @interface STXAttributedLabel : TTTAttributedLabel From 474ac5d969ed536e92633f2df7e70d89ee822f83 Mon Sep 17 00:00:00 2001 From: Ibrahim Ulukaya Date: Thu, 14 Apr 2016 14:47:16 -0400 Subject: [PATCH 13/23] add podspec --- STXDynamicTableView.podspec | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 STXDynamicTableView.podspec diff --git a/STXDynamicTableView.podspec b/STXDynamicTableView.podspec new file mode 100644 index 0000000..83ac3ac --- /dev/null +++ b/STXDynamicTableView.podspec @@ -0,0 +1,21 @@ +Pod::Spec.new do |s| + s.name = "STXDynamicTableView" + s.version = "1.0.0" + s.summary = "Feed Style Dynamic Table View" + s.homepage = "https://github.com/2359media/STXDynamicTableView" + s.license = { :type => 'MIT' } + s.author = { "2359media" => "http://2359media.com" } + s.source = { :git => "https://github.com/2359media/STXDynamicTableView.git"} + s.platform = :ios + s.ios.deployment_target = "8.0" + s.ios.framework = "UIKit" + s.requires_arc = true + s.source_files = "STXDynamicTableView/STXDynamicTableView.h", "STXDynamicTableView/**/*.{h,m}" + s.resources = "STXDynamicTableView/**/*.xib" + s.dependency 'TTTAttributedLabel' + s.dependency 'PureLayout' + s.dependency 'KZPropertyMapper' + s.dependency 'MHPrettyDate' + s.dependency 'AFNetworking', '~> 2.5.0' + s.dependency 'UALogger' +end From 50658b41513e371088a7cac64e066086c34695a4 Mon Sep 17 00:00:00 2001 From: Ibrahim Ulukaya Date: Thu, 14 Apr 2016 14:53:46 -0400 Subject: [PATCH 14/23] add postItem and indexPath to userActionCell --- STXDynamicTableView/Protocols/STXFeedTableViewDataSource.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/STXDynamicTableView/Protocols/STXFeedTableViewDataSource.m b/STXDynamicTableView/Protocols/STXFeedTableViewDataSource.m index 8f3db33..83343bc 100644 --- a/STXDynamicTableView/Protocols/STXFeedTableViewDataSource.m +++ b/STXDynamicTableView/Protocols/STXFeedTableViewDataSource.m @@ -170,8 +170,11 @@ - (STXCommentCell *)commentCellForTableView:(UITableView *)tableView atIndexPath - (STXUserActionCell *)userActionCellForTableView:(UITableView *)tableView atIndexPath:(NSIndexPath *)indexPath { + id postItem = self.posts[indexPath.section]; STXUserActionCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([STXUserActionCell class]) forIndexPath:indexPath]; + cell.postItem = postItem; cell.delegate = self.controller; + cell.indexPath = indexPath; return cell; } From a3287f8d6dde9b3d379c9037538a271b2cac61d1 Mon Sep 17 00:00:00 2001 From: Ibrahim Ulukaya Date: Thu, 14 Apr 2016 15:16:06 -0400 Subject: [PATCH 15/23] connect user actions to existing IBOutlets --- .../Cells/STXUserActionCell.xib | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/STXDynamicTableView/Cells/STXUserActionCell.xib b/STXDynamicTableView/Cells/STXUserActionCell.xib index e24fcee..1bc1e6c 100644 --- a/STXDynamicTableView/Cells/STXUserActionCell.xib +++ b/STXDynamicTableView/Cells/STXUserActionCell.xib @@ -1,8 +1,7 @@ - + - - + @@ -16,10 +15,13 @@ @@ -30,16 +32,22 @@ From b4031e4a2c399acb3275fe9e40207bb73dd5feb5 Mon Sep 17 00:00:00 2001 From: Ibrahim Ulukaya Date: Thu, 14 Apr 2016 15:42:40 -0400 Subject: [PATCH 16/23] move useractioncell to top --- .../Protocols/STXFeedTableViewDataSource.m | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/STXDynamicTableView/Protocols/STXFeedTableViewDataSource.m b/STXDynamicTableView/Protocols/STXFeedTableViewDataSource.m index 83343bc..a6d27eb 100644 --- a/STXDynamicTableView/Protocols/STXFeedTableViewDataSource.m +++ b/STXDynamicTableView/Protocols/STXFeedTableViewDataSource.m @@ -15,8 +15,9 @@ #import "STXUserActionCell.h" #define PHOTO_CELL_ROW 0 -#define LIKES_CELL_ROW 1 -#define CAPTION_CELL_ROW 2 +#define USERACTION_CELL_ROW 1 +#define LIKES_CELL_ROW 2 +#define CAPTION_CELL_ROW 3 #define NUMBER_OF_STATIC_ROWS 4 #define MAX_NUMBER_OF_COMMENTS 5 @@ -182,7 +183,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N { UITableViewCell *cell; - NSInteger captionRowOffset = 3; + NSInteger captionRowOffset = 4; id postItem = self.posts[indexPath.section]; NSInteger commentsCount = MIN(MAX_NUMBER_OF_COMMENTS, [postItem totalComments]); @@ -190,17 +191,17 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N if (indexPath.row == PHOTO_CELL_ROW) { cell = [self photoCellForTableView:tableView atIndexPath:indexPath]; + } else if (indexPath.row == USERACTION_CELL_ROW) { + cell = [self userActionCellForTableView:tableView atIndexPath:indexPath]; } else if (indexPath.row == LIKES_CELL_ROW) { cell = [self likesCellForTableView:tableView atIndexPath:indexPath]; } else if (indexPath.row == CAPTION_CELL_ROW) { cell = [self captionCellForTableView:tableView atIndexPath:indexPath]; - } else if (indexPath.row > CAPTION_CELL_ROW && indexPath.row < commentsRowLimit) { + } else { NSIndexPath *commentIndexPath = [NSIndexPath indexPathForRow:indexPath.row-captionRowOffset inSection:indexPath.section]; cell = [self commentCellForTableView:tableView atIndexPath:commentIndexPath]; - } else { - cell = [self userActionCellForTableView:tableView atIndexPath:indexPath]; } - + [cell setNeedsUpdateConstraints]; [cell updateConstraintsIfNeeded]; From 83f47fa0e0898a1485cddbf54b1ff744a41e91fb Mon Sep 17 00:00:00 2001 From: Ibrahim Ulukaya Date: Thu, 14 Apr 2016 16:25:33 -0400 Subject: [PATCH 17/23] using open source images for user action buttons --- STXDynamicTableView.podspec | 2 +- .../Cells/STXFeedPhotoCell.xib | 13 +++++----- STXDynamicTableView/Cells/STXUserActionCell.m | 24 +++--------------- .../Cells/STXUserActionCell.xib | 23 ++++++++++------- .../ic_comment.imageset/Contents.json | 23 +++++++++++++++++ .../ic_comment.imageset/ic_comment.png | Bin 0 -> 140 bytes .../ic_comment.imageset/ic_comment_2x.png | Bin 0 -> 204 bytes .../ic_comment.imageset/ic_comment_3x.png | Bin 0 -> 262 bytes .../ic_favorite.imageset/Contents.json | 23 +++++++++++++++++ .../ic_favorite.imageset/ic_favorite.png | Bin 0 -> 247 bytes .../ic_favorite.imageset/ic_favorite_2x.png | Bin 0 -> 437 bytes .../ic_favorite.imageset/ic_favorite_3x.png | Bin 0 -> 636 bytes .../ic_favorite_border.imageset/Contents.json | 23 +++++++++++++++++ .../ic_favorite_border.png | Bin 0 -> 339 bytes .../ic_favorite_border_2x.png | Bin 0 -> 673 bytes .../ic_favorite_border_3x.png | Bin 0 -> 981 bytes .../ic_share.imageset/Contents.json | 23 +++++++++++++++++ .../ic_share.imageset/ic_share.png | Bin 0 -> 262 bytes .../ic_share.imageset/ic_share_2x.png | Bin 0 -> 483 bytes .../ic_share.imageset/ic_share_3x.png | Bin 0 -> 675 bytes 20 files changed, 117 insertions(+), 37 deletions(-) create mode 100644 STXDynamicTableView/Images.xcassets/ic_comment.imageset/Contents.json create mode 100644 STXDynamicTableView/Images.xcassets/ic_comment.imageset/ic_comment.png create mode 100644 STXDynamicTableView/Images.xcassets/ic_comment.imageset/ic_comment_2x.png create mode 100644 STXDynamicTableView/Images.xcassets/ic_comment.imageset/ic_comment_3x.png create mode 100644 STXDynamicTableView/Images.xcassets/ic_favorite.imageset/Contents.json create mode 100644 STXDynamicTableView/Images.xcassets/ic_favorite.imageset/ic_favorite.png create mode 100644 STXDynamicTableView/Images.xcassets/ic_favorite.imageset/ic_favorite_2x.png create mode 100644 STXDynamicTableView/Images.xcassets/ic_favorite.imageset/ic_favorite_3x.png create mode 100644 STXDynamicTableView/Images.xcassets/ic_favorite_border.imageset/Contents.json create mode 100644 STXDynamicTableView/Images.xcassets/ic_favorite_border.imageset/ic_favorite_border.png create mode 100644 STXDynamicTableView/Images.xcassets/ic_favorite_border.imageset/ic_favorite_border_2x.png create mode 100644 STXDynamicTableView/Images.xcassets/ic_favorite_border.imageset/ic_favorite_border_3x.png create mode 100644 STXDynamicTableView/Images.xcassets/ic_share.imageset/Contents.json create mode 100644 STXDynamicTableView/Images.xcassets/ic_share.imageset/ic_share.png create mode 100644 STXDynamicTableView/Images.xcassets/ic_share.imageset/ic_share_2x.png create mode 100644 STXDynamicTableView/Images.xcassets/ic_share.imageset/ic_share_3x.png diff --git a/STXDynamicTableView.podspec b/STXDynamicTableView.podspec index 83ac3ac..58677fa 100644 --- a/STXDynamicTableView.podspec +++ b/STXDynamicTableView.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.ios.framework = "UIKit" s.requires_arc = true s.source_files = "STXDynamicTableView/STXDynamicTableView.h", "STXDynamicTableView/**/*.{h,m}" - s.resources = "STXDynamicTableView/**/*.xib" + s.resources = "STXDynamicTableView/**/*.xib", "STXDynamicTableView/Images.xcassets" s.dependency 'TTTAttributedLabel' s.dependency 'PureLayout' s.dependency 'KZPropertyMapper' diff --git a/STXDynamicTableView/Cells/STXFeedPhotoCell.xib b/STXDynamicTableView/Cells/STXFeedPhotoCell.xib index 0898a82..5b6fbac 100644 --- a/STXDynamicTableView/Cells/STXFeedPhotoCell.xib +++ b/STXDynamicTableView/Cells/STXFeedPhotoCell.xib @@ -1,8 +1,7 @@ - + - - + @@ -15,7 +14,7 @@ - + @@ -32,15 +31,15 @@ diff --git a/STXDynamicTableView/Cells/STXUserActionCell.m b/STXDynamicTableView/Cells/STXUserActionCell.m index 31c71f8..fce472d 100644 --- a/STXDynamicTableView/Cells/STXUserActionCell.m +++ b/STXDynamicTableView/Cells/STXUserActionCell.m @@ -8,8 +8,6 @@ #import "STXUserActionCell.h" -#import "UIButton+STXButton.h" - @interface STXUserActionCell () @property (weak, nonatomic) IBOutlet UIButton *likeButton; @@ -50,27 +48,16 @@ - (void)setPostItem:(id)postItem { _postItem = postItem; - NSString *likeButtonTitle = postItem.liked ? NSLocalizedString(@"Loved", nil) : NSLocalizedString(@"Love", nil); - [self.likeButton setTitle:likeButtonTitle forState:UIControlStateNormal]; - - if (postItem.liked) { - [self.likeButton stx_setSelectedAppearance]; - } else { - [self.likeButton stx_setNormalAppearance]; - } + [self.likeButton setImage:[UIImage imageNamed:(postItem.liked ? @"ic_favorite" : @"ic_favorite_border")] + forState:UIControlStateNormal]; } #pragma mark - Action - (void)setButton:(UIButton *)button toLoved:(BOOL)loved { - if (loved) { - [button setTitle:NSLocalizedString(@"Loved", nil) forState:UIControlStateNormal]; - [button stx_setSelectedAppearance]; - } else { - [button setTitle:NSLocalizedString(@"Love", nil) forState:UIControlStateNormal]; - [button stx_setNormalAppearance]; - } + [self.likeButton setImage:[UIImage imageNamed:(loved ? @"ic_favorite" : @"ic_favorite_border")] + forState:UIControlStateNormal]; } - (IBAction)like:(id)sender @@ -81,9 +68,6 @@ - (IBAction)like:(id)sender return; } - // Prevent rapid interaction - [sender setUserInteractionEnabled:NO]; - if (![self.postItem liked]) { [self setButton:sender toLoved:YES]; diff --git a/STXDynamicTableView/Cells/STXUserActionCell.xib b/STXDynamicTableView/Cells/STXUserActionCell.xib index 1bc1e6c..c836e5d 100644 --- a/STXDynamicTableView/Cells/STXUserActionCell.xib +++ b/STXDynamicTableView/Cells/STXUserActionCell.xib @@ -14,9 +14,9 @@ - - - - - + + - - + + @@ -87,8 +92,13 @@ - - - + + + + + + + + diff --git a/STXDynamicTableView/Protocols/STXFeedTableViewDataSource.m b/STXDynamicTableView/Protocols/STXFeedTableViewDataSource.m index a6d27eb..416cb82 100644 --- a/STXDynamicTableView/Protocols/STXFeedTableViewDataSource.m +++ b/STXDynamicTableView/Protocols/STXFeedTableViewDataSource.m @@ -38,11 +38,14 @@ - (instancetype)initWithController:(id /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; - showEnvVarsInLog = 0; - }; - 46FB61A0D3734DDC91CA4CEC /* Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-STXDynamicTableViewExample/Pods-STXDynamicTableViewExample-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - /* Begin PBXSourcesBuildPhase section */ 0196481D18EAB434001185C3 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -631,7 +584,6 @@ }; 0196484E18EAB434001185C3 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 9AED87155782343E4057840A /* Pods-STXDynamicTableViewExample.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; @@ -647,7 +599,6 @@ }; 0196484F18EAB434001185C3 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 2BDE37AE74C190EAE2837A7A /* Pods-STXDynamicTableViewExample.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; @@ -663,7 +614,6 @@ }; 0196485118EAB434001185C3 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 9AED87155782343E4057840A /* Pods-STXDynamicTableViewExample.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/STXDynamicTableViewExample.app/STXDynamicTableViewExample"; FRAMEWORK_SEARCH_PATHS = ( @@ -687,7 +637,6 @@ }; 0196485218EAB434001185C3 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 2BDE37AE74C190EAE2837A7A /* Pods-STXDynamicTableViewExample.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/STXDynamicTableViewExample.app/STXDynamicTableViewExample"; FRAMEWORK_SEARCH_PATHS = ( diff --git a/STXDynamicTableViewExample/Images.xcassets/AppIcon.appiconset/Contents.json b/STXDynamicTableViewExample/Images.xcassets/AppIcon.appiconset/Contents.json index 91bf9c1..1d060ed 100644 --- a/STXDynamicTableViewExample/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/STXDynamicTableViewExample/Images.xcassets/AppIcon.appiconset/Contents.json @@ -1,20 +1,55 @@ { "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, { "idiom" : "iphone", "size" : "29x29", "scale" : "2x" }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, { "idiom" : "iphone", "size" : "40x40", "scale" : "2x" }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, { "idiom" : "iphone", "size" : "60x60", "scale" : "2x" }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, { "idiom" : "ipad", "size" : "29x29", @@ -44,6 +79,11 @@ "idiom" : "ipad", "size" : "76x76", "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" } ], "info" : { From 0912ccd130d4cbed145cfc985e5d78325016191e Mon Sep 17 00:00:00 2001 From: Ibrahim Ulukaya Date: Tue, 25 Jul 2017 15:16:15 -0400 Subject: [PATCH 22/23] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c7610f5..fe4db26 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ install: - bundle exec pod install script: - "./build.sh" -osx_image: xcode7 +osx_image: xcode8.3 env: global: - REPO_SLUG="2359media/STXDynamicTableView" From a66a76d2fc31ce9ccdb99cf7268a8de255556930 Mon Sep 17 00:00:00 2001 From: Ibrahim Ulukaya Date: Fri, 22 Sep 2017 15:15:42 -0400 Subject: [PATCH 23/23] Update STXFeedTableViewDelegate.m --- STXDynamicTableView/Protocols/STXFeedTableViewDelegate.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/STXDynamicTableView/Protocols/STXFeedTableViewDelegate.m b/STXDynamicTableView/Protocols/STXFeedTableViewDelegate.m index 344316b..c8bbf25 100644 --- a/STXDynamicTableView/Protocols/STXFeedTableViewDelegate.m +++ b/STXDynamicTableView/Protocols/STXFeedTableViewDelegate.m @@ -67,6 +67,14 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath [tableView deselectRowAtIndexPath:indexPath animated:NO]; } +- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath +{ + id tableViewDelegate = (id)self.controller; + if ([tableViewDelegate respondsToSelector:@selector(tableView:willDisplayCell:forRowAtIndexPath:)]) { + [tableViewDelegate tableView:tableView willDisplayCell:cell forRowAtIndexPath:indexPath]; + } +} + #pragma mark - Row Updates - (void)reloadAtIndexPath:(NSIndexPath *)indexPath forTableView:(UITableView *)tableView