Update to use the UIView extension in RSCore

This commit is contained in:
Maurice Parker 2019-04-20 09:50:44 -05:00
parent 936e727842
commit f2191f1dcc
4 changed files with 13 additions and 21 deletions

View File

@ -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
}
}
}

View File

@ -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)
}
}

View File

@ -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)
}
}

@ -1 +1 @@
Subproject commit 42de80e9f4114163b9af344ac4e538005611e33e
Subproject commit ac59e34818d4a0c2d3e510f0dad4adf33cf43ce7