Hello every developers. I need your help. Do you know how to attach animation to appearance, like a smooth transition from dark to light and vise versa. My code here: @main struct The_Library_of_BabelonApp: App { @AppStorage(selectedAppearance) private var selectedAppearance = 0 @StateObject private var router = AppRouter() var scheme: ColorScheme? { if selectedAppearance == 1 { return .light } if selectedAppearance == 2 { return .dark } return nil } var body: some Scene { WindowGroup { RootView() .preferredColorScheme(scheme) .environmentObject(router) // this is doesn't work correctly .animation(.smooth(duration: 2), value: selectedAppearance) } } } And my appearance switching looks: struct SettingsView: View { @AppStorage(selectedAppearance) private var selectedAppearance = 0 var body: some View { List { Section(header: Text(Appearance)) { HStack(spacing: 20) { ThemePreview(title: Light, imageName: lightTheme, tag: 1, selection: $selectedAppearance) ThemePreview(title: Dark, imageName: da
1
0
78