Three enums are set to achieve:
UIUserInterfaceStyleUnspecified
-> To listen to iOS setting mode change
UIUserInterfaceStyleLight
-> To override LIGHT mode irrespective of iOS setting mode
UIUserInterfaceStyleDark
-> To override DARK mode irrespective of iOS setting mode
The problem arises when I set
(Parent_ViewController -> UIUserInterfaceStyleDark)
and
(Child_ViewController -> UIUserInterfaceStyleUnspecified)
And then when we switch the settings iOS mode from light to dark or vice versa, there's no change in UI of Child_ViewController
and being UIUserInterfaceStyleUnspecified
it should've changed but it always has dark theme colors.
Any workarounds or solution is there to address this problem?
Welcome!
ViewControllers will stop propagating the system changes to child controllers when they override the interface style. This also means that a child VC will inherit the interface style of its parent when
overrideUserInterfaceStyle
is set to.unspecified
.I'm afraid you need some custom implementation if you want to achieve that specific behavior. For instance, by setting the parts you always want to be dark to concrete (undynamic) colors instead of using dynamic system colors.