Search code examples
iosswiftstoryboardios-darkmode

Force the Dark Mode to only one UI Element in Swift by storyboard or programmatically


I want to set the dark mode fixed for one UI element.

So I want that all the app switch automatically from dark to light but one element in my case a UISegmentedControl stays in dark mode.

Is it possible?


Solution

  • Yes, you can set overrideUserInterfaceStyle on the control to .dark.