Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// 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