From f2191f1dcce88866f125346ac270c76f02d82cdf Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Sat, 20 Apr 2019 09:50:44 -0500 Subject: [PATCH] Update to use the UIView extension in RSCore --- iOS/Master/Cell/MasterTableViewCell.swift | 16 ++++------------ .../Cell/MasterTableViewSectionHeader.swift | 4 ++-- .../Cell/MasterTimelineTableViewCell.swift | 12 ++++++------ submodules/RSCore | 2 +- 4 files changed, 13 insertions(+), 21 deletions(-) diff --git a/iOS/Master/Cell/MasterTableViewCell.swift b/iOS/Master/Cell/MasterTableViewCell.swift index 4ab775021..d81cea3fb 100644 --- a/iOS/Master/Cell/MasterTableViewCell.swift +++ b/iOS/Master/Cell/MasterTableViewCell.swift @@ -167,18 +167,10 @@ private extension MasterTableViewCell { } func layoutWith(_ layout: MasterTableViewCellLayout) { - faviconImageView.rs_setFrameIfNotEqual(layout.faviconRect) - titleView.rs_setFrameIfNotEqual(layout.titleRect) - unreadCountView.rs_setFrameIfNotEqual(layout.unreadCountRect) - disclosureButton?.rs_setFrameIfNotEqual(layout.disclosureButtonRect) + faviconImageView.setFrameIfNotEqual(layout.faviconRect) + titleView.setFrameIfNotEqual(layout.titleRect) + unreadCountView.setFrameIfNotEqual(layout.unreadCountRect) + disclosureButton?.setFrameIfNotEqual(layout.disclosureButtonRect) } } - -extension UIView { - func rs_setFrameIfNotEqual(_ rect: CGRect) { - if !self.frame.equalTo(rect) { - self.frame = rect - } - } -} diff --git a/iOS/Master/Cell/MasterTableViewSectionHeader.swift b/iOS/Master/Cell/MasterTableViewSectionHeader.swift index df91732be..beaa98398 100644 --- a/iOS/Master/Cell/MasterTableViewSectionHeader.swift +++ b/iOS/Master/Cell/MasterTableViewSectionHeader.swift @@ -91,8 +91,8 @@ private extension MasterTableViewSectionHeader { } func layoutWith(_ layout: MasterTableViewCellLayout) { - titleView.rs_setFrameIfNotEqual(layout.titleRect) - unreadCountView.rs_setFrameIfNotEqual(layout.unreadCountRect) + titleView.setFrameIfNotEqual(layout.titleRect) + unreadCountView.setFrameIfNotEqual(layout.unreadCountRect) } } diff --git a/iOS/Timeline/Cell/MasterTimelineTableViewCell.swift b/iOS/Timeline/Cell/MasterTimelineTableViewCell.swift index 41cc9631f..ab536d22b 100644 --- a/iOS/Timeline/Cell/MasterTimelineTableViewCell.swift +++ b/iOS/Timeline/Cell/MasterTimelineTableViewCell.swift @@ -59,11 +59,11 @@ class MasterTimelineTableViewCell: UITableViewCell { setFrame(for: summaryView, rect: layoutRects.summaryRect) setFrame(for: textView, rect: layoutRects.textRect) - dateView.rs_setFrameIfNotEqual(layoutRects.dateRect) - unreadIndicatorView.rs_setFrameIfNotEqual(layoutRects.unreadIndicatorRect) - feedNameView.rs_setFrameIfNotEqual(layoutRects.feedNameRect) - avatarImageView.rs_setFrameIfNotEqual(layoutRects.avatarImageRect) - starView.rs_setFrameIfNotEqual(layoutRects.starRect) + dateView.setFrameIfNotEqual(layoutRects.dateRect) + unreadIndicatorView.setFrameIfNotEqual(layoutRects.unreadIndicatorRect) + feedNameView.setFrameIfNotEqual(layoutRects.feedNameRect) + avatarImageView.setFrameIfNotEqual(layoutRects.avatarImageRect) + starView.setFrameIfNotEqual(layoutRects.starRect) } @@ -94,7 +94,7 @@ private extension MasterTimelineTableViewCell { hideView(label) } else { showView(label) - label.rs_setFrameIfNotEqual(rect) + label.setFrameIfNotEqual(rect) } } diff --git a/submodules/RSCore b/submodules/RSCore index 42de80e9f..ac59e3481 160000 --- a/submodules/RSCore +++ b/submodules/RSCore @@ -1 +1 @@ -Subproject commit 42de80e9f4114163b9af344ac4e538005611e33e +Subproject commit ac59e34818d4a0c2d3e510f0dad4adf33cf43ce7