Lee Kah Seng
1 min readDec 25, 2019

--

Hi, thanks for the response.

If I am not mistaken, traitCollectionDidChange(_:) will trigger when the system level user interface style is updated. Since we are trying to have our own dark mode setting within our app, thus we will have to use overrideUserInterfaceStyle and cannot rely on traitCollectionDidChange(_:) .

Regarding setting overrideUserInterfaceStyle on a UIWindow level, that is definitely one of the way, however I will prefer to do it in a view controller level so that I can have more control and flexibility on which view controller should / should not observe to the in-app dark mode setting changes. 🙂

--

--

Lee Kah Seng
Lee Kah Seng

Written by Lee Kah Seng

Support me by becoming a Medium member: https://leekahseng.medium.com/membership ⦿ 🇲🇾 Creator of https://swiftsenpai.com ⦿ iOS developer since 2011

No responses yet