How To: iOS WebView Apps & Dark Mode – display a customized URL if activated 🌚

“Come to the dark side”… not only a famous quote but also a real possibility since Apple launched the Dark Mode option in iOS 13 this year. As an Xcode/iOS App developer developing rather hybrid WebView apps instead of native iOS apps, you might ask how to handle this new cool feature of Apple in order to provide your users that “little extra” cool user experience. Good news: The WebViewGold app template for Xcode is able to define two URLs for both Default Mode and Dark Mode. The URL in the webviewurl variable will be used if the iOS user is in light mode/default mode of iOS, while the URL in the optional variabledarkmodewebviewurl will be used while being in activated Dark Mode.

This is how to redirect to a different web address while being in iOS Dark Mode on your WebView app:

  • Download the WebViewGold template for iOS here.
    or book our full all-inclusive WeSetupYourWebViewApp service.
  • Afterward, just insert your customized Dark Mode URL in the darkmodewebviewurl variable.

That’s it, enjoy it! 🙂