Today Extension does not reflect change of UserInterfaceStyle (dark/light mode)

Originator:adam.studenic
Number:rdar://FB7575390 Date Originated:12/02/2020
Status:Open Resolved:No
Product:iOS Product Version:iOS 13
Classification:Dark mode Reproducible:Yes
 
Description:
The Today Extension widget does not reflect the changes of UserInterfaceStyle, when the dark/light modes are changed when running the extension target.

Steps to reproduce:
1. Open the example app and run the TodayExtension scheme
2. Swipe to Extensions screen and check the value `print(traitCollection.userInterfaceStyle.rawValue)` in `TodayViewController.swift:22`
3. Go to Settings and enable Dark mode
4. Swipe to Extensions screen and check the value `print(traitCollection.userInterfaceStyle.rawValue)` in `TodayViewController.swift:22`
5. The value of the `traitCollection.userInterfaceStyle.rawValue` has not changed when changing the mode (light/dark)

Expected result:
The value of `traitCollection.userInterfaceStyle.rawValue` would change accordingly when the mode has been changed in the settings

Actual result: 
The value of the `traitCollection.userInterfaceStyle.rawValue` has not changed when changing the mode (light/dark)

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!