Skip to content
Snippets Groups Projects
Commit f9033c52 authored by Zandor Smith's avatar Zandor Smith :computer:
Browse files

Disable the use of the WhiteNavigationBarBlur when on iOS 13 or higher.

Since iOS 13 natively supports this style.
parent cc82c5eb
No related branches found
No related tags found
No related merge requests found
Pipeline #5894 failed
......@@ -18,27 +18,29 @@ open class WhiteNavigationController: UINavigationController {
override open func viewDidLoad() {
super.viewDidLoad()
self.barBlur = WhiteNavigationBarBlur(effect: UIBlurEffect(style: .light))
if #available(iOS 13, *) {} else {
self.barBlur = WhiteNavigationBarBlur(effect: UIBlurEffect(style: .light))
self.navigationBar.isTranslucent = true
self.navigationBar.setBackgroundImage(UIImage(), for: .default)
self.navigationBar.addSubview(self.barBlur!)
self.navigationBar.isTranslucent = true
self.navigationBar.setBackgroundImage(UIImage(), for: .default)
self.navigationBar.addSubview(self.barBlur!)
NotificationCenter.default.addObserver(self, selector: #selector(deviceOrientationDidChange), name: UIDevice.orientationDidChangeNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(deviceOrientationDidChange), name: UIDevice.orientationDidChangeNotification, object: nil)
}
}
override open func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.barBlur?.layoutSubviews()
}
override open func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
if #available(iOS 13, *) {} else {
self.barBlur?.layoutSubviews()
}
}
@objc func deviceOrientationDidChange(_ notification: Notification) {
self.barBlur?.layoutSubviews()
if #available(iOS 13, *) {} else {
self.barBlur?.layoutSubviews()
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment