File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ public final class UIKitBackend: AppBackend {
1010 static var mainWindow : UIWindow ?
1111 static var hasReturnedAWindow = false
1212
13+ private var timeZoneObserver : NSObjectProtocol ?
14+
1315 public let scrollBarWidth = 0
1416 public let defaultPaddingAmount = 15
1517 public let requiresToggleSwitchSpacer = true
@@ -87,6 +89,7 @@ public final class UIKitBackend: AppBackend {
8789 var environment = defaultEnvironment
8890
8991 environment. toggleStyle = . switch
92+ environment. timeZone = . current
9093
9194 switch UITraitCollection . current. userInterfaceStyle {
9295 case . light:
@@ -102,6 +105,17 @@ public final class UIKitBackend: AppBackend {
102105
103106 public func setRootEnvironmentChangeHandler( to action: @escaping ( ) -> Void ) {
104107 onTraitCollectionChange = action
108+ if timeZoneObserver == nil {
109+ timeZoneObserver = NotificationCenter . default. addObserver (
110+ forName: . NSSystemTimeZoneDidChange,
111+ object: nil ,
112+ queue: . main
113+ ) { [ unowned self] _ in
114+ MainActor . assumeIsolated {
115+ self . onTraitCollectionChange ? ( )
116+ }
117+ }
118+ }
105119 }
106120
107121 public func computeWindowEnvironment(
You can’t perform that action at this time.
0 commit comments