Преглед на файлове

PresentationTheme: Fix statusBarStyle for iOS13

With iOS 13, `.darkContent` style was introduced which breaks the light
theme statusBarStyle.

This ensures that the right statusBarStyle is used on iOS 13.
Edgar Fouillet преди 5 години
родител
ревизия
f3cd4a51f6
променени са 1 файла, в които са добавени 13 реда и са изтрити 1 реда
  1. 13 1
      SharedSources/PresentationTheme.swift

+ 13 - 1
SharedSources/PresentationTheme.swift

@@ -143,7 +143,7 @@ extension Notification.Name {
 
 let brightPalette = ColorPalette(isDark: false,
                                  name: "Default",
-                                 statusBarStyle: .default,
+                                 statusBarStyle: .autoDarkContent,
                                  navigationbarColor: UIColor(0xFFFFFF),
                                  navigationbarTextColor: UIColor(0x000000),
                                  background: UIColor(0xFFFFFF),
@@ -178,3 +178,15 @@ let darkPalette = ColorPalette(isDark: true,
                                toolBarStyle: UIBarStyle.black)
 
 let defaultFont = Typography(tableHeaderFont: UIFont.systemFont(ofSize: 24, weight: .semibold))
+
+// MARK: - UIStatusBarStyle - autoDarkContent
+
+extension UIStatusBarStyle {
+    static var autoDarkContent: UIStatusBarStyle {
+        if #available(iOS 13.0, *) {
+            return .darkContent
+        } else {
+            return .default
+        }
+    }
+}