Override textField and imageView didSet — their properties weren’t getting set in commonInit, because they weren’t set yet.

This commit is contained in:
Brent Simmons 2018-12-05 21:48:31 -08:00
parent ceb061f616
commit 8545d3422f

View File

@ -90,13 +90,23 @@ class SidebarCell : NSTableCellView {
override var isFlipped: Bool {
return true
}
override var textField: NSTextField? {
didSet {
textField?.translatesAutoresizingMaskIntoConstraints = false
updateTextFieldIsEditable()
}
}
override var imageView: NSImageView? {
didSet {
imageView?.translatesAutoresizingMaskIntoConstraints = false
}
}
private func commonInit() {
unreadCountView.translatesAutoresizingMaskIntoConstraints = false
imageView?.translatesAutoresizingMaskIntoConstraints = false
textField?.translatesAutoresizingMaskIntoConstraints = false
addSubview(unreadCountView)
updateTextFieldIsEditable()
}
override init(frame frameRect: NSRect) {