Fixed bug that incorrectly determining the showing edit control state.

This commit is contained in:
Maurice Parker
2019-04-17 07:48:38 -05:00
parent d769cf0af2
commit 1c6c2451ec
2 changed files with 10 additions and 4 deletions

View File

@@ -84,18 +84,24 @@ class MasterTableViewCell : UITableViewCell {
}()
private let unreadCountView = MasterUnreadCountView(frame: CGRect.zero)
private var showingEditControl = false
required init?(coder: NSCoder) {
super.init(coder: coder)
commonInit()
}
override func willTransition(to state: UITableViewCell.StateMask) {
super.willTransition(to: state)
showingEditControl = state == .showingEditControl
}
override func layoutSubviews() {
super.layoutSubviews()
let layout = MasterTableViewCellLayout(cellSize: bounds.size, shouldShowImage: shouldShowImage, label: titleView, unreadCountView: unreadCountView, isEditing: isEditing)
let layout = MasterTableViewCellLayout(cellSize: bounds.size, shouldShowImage: shouldShowImage, label: titleView, unreadCountView: unreadCountView, showingEditingControl: showingEditControl)
layoutWith(layout)
}
}
private extension MasterTableViewCell {