Skip to content

Commit de08354

Browse files
committed
uses separate trait registrations
1 parent 5841434 commit de08354

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

WooCommerce/Classes/Authentication/Navigation Exceptions/RoleErrorViewController.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,13 @@ class RoleErrorViewController: UIViewController {
102102
}
103103

104104
private func observeTraitChanges() {
105-
registerForTraitChanges([UITraitVerticalSizeClass.self, UITraitUserInterfaceStyle.self]) { (self: Self, _) in
106-
// Hide image in compact height sizes (e.g. landscape iPhones)
107-
// With limited space, text description should have higher priority
105+
// Image visibility depends on vertical size class only
106+
registerForTraitChanges([UITraitVerticalSizeClass.self]) { (self: Self, _) in
108107
self.imageView.isHidden = self.traitCollection.verticalSizeClass == .compact
108+
}
109109

110+
// Appearance updates only when dark/light mode changes
111+
registerForTraitChanges([UITraitUserInterfaceStyle.self]) { (self: Self, _) in
110112
self.updateViewAppearances()
111113
}
112114
}

0 commit comments

Comments
 (0)