I'm using the newest version of Xcode for my iOS app.
I'm stuck with one small task since hours:
I want to force my View Controller to always stay in light mode, also if device is in dark mode. I'm using this code:
overrideUserInterfaceStyle = .light
This is working very well.
But there's a WKWebView in the View Controller. I want this WKWebView to stay adaptable to the color mode, so I can check via CSS if the device is in light mode or dark mode.
I tried so much but nothing worked.
Is it even possible? How?
I suggest changing
UIInterfaceStyle
just right before invokingWKWebView
and setting it back beforeWKWebView
dismisses. You can useWKNavigationDelegate
for detectingWKWebView
dismissal.