Skip to content

Instantly share code, notes, and snippets.

@joshbuchea
Created October 20, 2020 16:26
Show Gist options
  • Save joshbuchea/c472ef47e0bb963412f4ad0334e68ad5 to your computer and use it in GitHub Desktop.
Save joshbuchea/c472ef47e0bb963412f4ad0334e68ad5 to your computer and use it in GitHub Desktop.
// https://stackoverflow.com/a/57280180/1492782
@Environment(\.colorScheme) var colorScheme: ColorScheme
var body: some View {
Button(action: {
foo()
}) {
Image(colorScheme == .light ? "lightImage" : "darkImage")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment