allCases
TypeScriptget allCases(): Array<ColorScheme>Swift declarationnonisolated static var allCases: [ColorScheme] { get }A collection of all values of this type.
enum · iOS 13.0+ · SDK 27.1
enum ColorSchemeThe possible color schemes, corresponding to the light and dark appearances. You receive a color scheme value when you read the ``EnvironmentValues/colorScheme`` environment value. The value tells you if a light or dark appearance currently applies to the view. SwiftUI updates the value whenever the appearance changes, and redraws views that depend on the value. For example, the following ``Text`` view automatically updates when the user enables Dark Mode: @Environment(\.colorScheme) private var colorScheme var body: some View { Text(colorScheme == .dark ? "Dark" : "Light") } Set a preferred appearance for a particular view hierarchy to override the user's Dark Mode setting using the ``View/preferredColorScheme(_:)`` view modifier.
get allCases(): Array<ColorScheme>Swift declarationnonisolated static var allCases: [ColorScheme] { get }A collection of all values of this type.
No declarations were skipped in this snapshot.