From f1d855310f3656b385fc91dc49c1dfb470969d8c Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Sun, 15 Jan 2023 17:05:22 +0100 Subject: [PATCH] Share sheet: honour system colors scheme --- IceCubesShareExtension/ShareViewController.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/IceCubesShareExtension/ShareViewController.swift b/IceCubesShareExtension/ShareViewController.swift index cb9f0c1d..4f09d865 100644 --- a/IceCubesShareExtension/ShareViewController.swift +++ b/IceCubesShareExtension/ShareViewController.swift @@ -18,9 +18,9 @@ class ShareViewController: UIViewController { let instance = CurrentInstance() account.setClient(client: client) instance.setClient(client: client) + let colorScheme = traitCollection.userInterfaceStyle let theme = Theme() - - overrideUserInterfaceStyle = theme.selectedScheme == .dark ? .dark : .light + theme.setColor(withName: colorScheme == .dark ? .iceCubeDark : .iceCubeLight) if let item = extensionContext?.inputItems.first as? NSExtensionItem { if let attachments = item.attachments { @@ -31,7 +31,7 @@ class ShareViewController: UIViewController { .environmentObject(theme) .environmentObject(instance) .tint(theme.tintColor) - .preferredColorScheme(theme.selectedScheme == .dark ? .dark : .light) + .preferredColorScheme(colorScheme == .light ? .light : .dark) let childView = UIHostingController(rootView: view) self.addChild(childView) childView.view.frame = self.container.bounds