浏览代码

Merge pull request #1053 from Infomaniak/fix-darkmode

Check dark mode at first launch - Fix #1052
Marino Faggiana 5 年之前
父节点
当前提交
b20d789351
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      iOSClient/Utility/CCUtility.m

+ 5 - 0
iOSClient/Utility/CCUtility.m

@@ -659,6 +659,11 @@
 
 + (BOOL)getDarkMode
 {
+    if ([self getDarkModeDetect]) {
+        if (@available(iOS 12.0, *)) {
+            return [UIScreen mainScreen].traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark;
+        }
+    }
     return [[UICKeyChainStore stringForKey:@"darkMode" service:k_serviceShareKeyChain] boolValue];
 }