From f9b73f3132fcc0edbaa71aa2a008e4e81f2a0bf2 Mon Sep 17 00:00:00 2001 From: "seongho.hong" Date: Fri, 15 Nov 2019 10:57:22 +0900 Subject: [PATCH] Update status bar style after rotation --- Demo/RootViewController.swift | 4 ++++ Sources/ToastWindow.swift | 1 + 2 files changed, 5 insertions(+) diff --git a/Demo/RootViewController.swift b/Demo/RootViewController.swift index 1549211..812ffc2 100644 --- a/Demo/RootViewController.swift +++ b/Demo/RootViewController.swift @@ -4,6 +4,10 @@ import Photos final class RootViewController: UIViewController { + override var preferredStatusBarStyle: UIStatusBarStyle { + .lightContent + } + override func viewDidLoad() { let button = UIButton(type: .system) button.setTitle("Show", for: .normal) diff --git a/Sources/ToastWindow.swift b/Sources/ToastWindow.swift index c258773..ac2513e 100644 --- a/Sources/ToastWindow.swift +++ b/Sources/ToastWindow.swift @@ -159,6 +159,7 @@ open class ToastWindow: UIWindow { let orientation = UIApplication.shared.statusBarOrientation self.handleRotate(orientation) self.isStatusBarOrientationChanging = false + rootViewController?.setNeedsStatusBarAppearanceUpdate() } @objc private func applicationDidBecomeActive() {