From 8545d3422f6d6324c1c2fece0b6cfabc92466783 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Wed, 5 Dec 2018 21:48:31 -0800 Subject: [PATCH] =?UTF-8?q?Override=20textField=20and=20imageView=20didSet?= =?UTF-8?q?=20=E2=80=94=20their=20properties=20weren=E2=80=99t=20getting?= =?UTF-8?q?=20set=20in=20commonInit,=20because=20they=20weren=E2=80=99t=20?= =?UTF-8?q?set=20yet.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MainWindow/Sidebar/Cell/SidebarCell.swift | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/NetNewsWire/MainWindow/Sidebar/Cell/SidebarCell.swift b/NetNewsWire/MainWindow/Sidebar/Cell/SidebarCell.swift index 007620763..f6b841b42 100644 --- a/NetNewsWire/MainWindow/Sidebar/Cell/SidebarCell.swift +++ b/NetNewsWire/MainWindow/Sidebar/Cell/SidebarCell.swift @@ -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) {