mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-22 23:58:36 +01:00
Fix deprecation warning by using registerForTraitChanges.
This commit is contained in:
parent
e60a9e55d7
commit
5109a69682
@ -28,15 +28,13 @@ class InteractiveNavigationController: UINavigationController {
|
||||
super.viewDidLoad()
|
||||
poppableDelegate.navigationController = self
|
||||
interactivePopGestureRecognizer?.delegate = poppableDelegate
|
||||
|
||||
registerForTraitChanges([UITraitUserInterfaceStyle.self], target: self, action: #selector(userInterfaceStyleDidChange))
|
||||
}
|
||||
|
||||
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
|
||||
super.traitCollectionDidChange(previousTraitCollection)
|
||||
if traitCollection.userInterfaceStyle != previousTraitCollection?.userInterfaceStyle {
|
||||
configure()
|
||||
}
|
||||
@objc func userInterfaceStyleDidChange() {
|
||||
configure()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// MARK: Private
|
||||
@ -62,5 +60,4 @@ private extension InteractiveNavigationController {
|
||||
toolbar.compactAppearance = toolbarAppearance
|
||||
toolbar.tintColor = AppAssets.primaryAccentColor
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user