From dfb9568f4fd8344b903fb47ba1978af4313aaaf4 Mon Sep 17 00:00:00 2001 From: nixzhu Date: Tue, 27 Oct 2015 14:55:56 +0800 Subject: [PATCH 1/3] uniq feedCreators for FeedSkillUsersCell --- Yep/Services/YepService.swift | 6 +++++- Yep/Views/Cells/FeedSkillUsers/FeedSkillUsersCell.swift | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Yep/Services/YepService.swift b/Yep/Services/YepService.swift index 3e70c27b..4c050f6f 100644 --- a/Yep/Services/YepService.swift +++ b/Yep/Services/YepService.swift @@ -1088,7 +1088,7 @@ enum DiscoveredUserSortStyle: String { } } -struct DiscoveredUser: Equatable { +struct DiscoveredUser: Hashable { struct SocialAccountProvider { let name: String @@ -1115,6 +1115,10 @@ struct DiscoveredUser: Equatable { let socialAccountProviders: [SocialAccountProvider] let recently_updated_provider: String? + + var hashValue: Int { + return id.hashValue + } } func ==(lhs: DiscoveredUser, rhs: DiscoveredUser) -> Bool { diff --git a/Yep/Views/Cells/FeedSkillUsers/FeedSkillUsersCell.swift b/Yep/Views/Cells/FeedSkillUsers/FeedSkillUsersCell.swift index 33f9ad95..48907e04 100644 --- a/Yep/Views/Cells/FeedSkillUsers/FeedSkillUsersCell.swift +++ b/Yep/Views/Cells/FeedSkillUsers/FeedSkillUsersCell.swift @@ -29,7 +29,7 @@ class FeedSkillUsersCell: UITableViewCell { func configureWithFeeds(feeds: [DiscoveredFeed]) { - let feedCreators = feeds.map({ $0.creator }) + let feedCreators = Array(Set(feeds.map({ $0.creator }))).sort { $0.lastSignInUnixTime > $1.lastSignInUnixTime } if let creator = feedCreators[safe: 0] { let plainAvatar = PlainAvatar(avatarURLString: creator.avatarURLString, avatarStyle: nanoAvatarStyle) From d386e12c3778989ad6e594402229be76565e7eb9 Mon Sep 17 00:00:00 2001 From: nixzhu Date: Tue, 27 Oct 2015 15:00:23 +0800 Subject: [PATCH 2/3] trans "People with this skill" --- Yep/Views/Cells/FeedSkillUsers/FeedSkillUsersCell.swift | 3 ++- Yep/en.lproj/Localizable.strings | 2 ++ Yep/zh-Hans.lproj/Localizable.strings | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Yep/Views/Cells/FeedSkillUsers/FeedSkillUsersCell.swift b/Yep/Views/Cells/FeedSkillUsers/FeedSkillUsersCell.swift index 48907e04..ef3678f6 100644 --- a/Yep/Views/Cells/FeedSkillUsers/FeedSkillUsersCell.swift +++ b/Yep/Views/Cells/FeedSkillUsers/FeedSkillUsersCell.swift @@ -18,7 +18,8 @@ class FeedSkillUsersCell: UITableViewCell { override func awakeFromNib() { super.awakeFromNib() - // Initialization code + + promptLabel.text = NSLocalizedString("People with this skill", comment: "") } override func setSelected(selected: Bool, animated: Bool) { diff --git a/Yep/en.lproj/Localizable.strings b/Yep/en.lproj/Localizable.strings index 0e4f6afb..0b3b71f3 100644 --- a/Yep/en.lproj/Localizable.strings +++ b/Yep/en.lproj/Localizable.strings @@ -640,3 +640,5 @@ "Choose..." = "Choose..."; +"People with this skill" = "People with this skill"; + diff --git a/Yep/zh-Hans.lproj/Localizable.strings b/Yep/zh-Hans.lproj/Localizable.strings index 10130ba7..9dc5cf20 100644 --- a/Yep/zh-Hans.lproj/Localizable.strings +++ b/Yep/zh-Hans.lproj/Localizable.strings @@ -650,3 +650,5 @@ "Choose..." = "选择…"; +"People with this skill" = "与此技能相关的用户"; + From b3a7d943131ae3197756c068e869d6119498286b Mon Sep 17 00:00:00 2001 From: nixzhu Date: Tue, 27 Oct 2015 15:04:49 +0800 Subject: [PATCH 3/3] accessoryImageView color --- .../FeedSkillUsers/FeedSkillUsersCell.swift | 4 ++++ .../FeedSkillUsers/FeedSkillUsersCell.xib | 21 ++++++++++--------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/Yep/Views/Cells/FeedSkillUsers/FeedSkillUsersCell.swift b/Yep/Views/Cells/FeedSkillUsers/FeedSkillUsersCell.swift index ef3678f6..7b5a935d 100644 --- a/Yep/Views/Cells/FeedSkillUsers/FeedSkillUsersCell.swift +++ b/Yep/Views/Cells/FeedSkillUsers/FeedSkillUsersCell.swift @@ -16,10 +16,14 @@ class FeedSkillUsersCell: UITableViewCell { @IBOutlet weak var avatarImageView2: UIImageView! @IBOutlet weak var avatarImageView3: UIImageView! + @IBOutlet weak var accessoryImageView: UIImageView! + override func awakeFromNib() { super.awakeFromNib() promptLabel.text = NSLocalizedString("People with this skill", comment: "") + + accessoryImageView.tintColor = UIColor.yepCellAccessoryImageViewTintColor() } override func setSelected(selected: Bool, animated: Bool) { diff --git a/Yep/Views/Cells/FeedSkillUsers/FeedSkillUsersCell.xib b/Yep/Views/Cells/FeedSkillUsers/FeedSkillUsersCell.xib index aa1f688e..386caa7c 100644 --- a/Yep/Views/Cells/FeedSkillUsers/FeedSkillUsersCell.xib +++ b/Yep/Views/Cells/FeedSkillUsers/FeedSkillUsersCell.xib @@ -20,13 +20,6 @@ - - - - - - - @@ -34,9 +27,6 @@ - - - @@ -44,6 +34,16 @@ + + + + + + + + + + @@ -59,6 +59,7 @@ +