Created
October 12, 2021 00:41
-
-
Save mattyoung/5cbbcbade56be49f2496eb1494ddaa3c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct ContentView: View { | |
var body: some View { | |
VStack { | |
Group { | |
Text(".tint(_:)") | |
Button("Default") { } | |
// .tint(nil) works better than .accentColor(nil): it's app's accentColor | |
Button(".tint(nil)") { } | |
.tint(nil) // how to instead inherit from parent view, .mint? | |
} | |
.tint(.mint) | |
Divider() | |
Group { | |
Text(".accentColor(_:)") | |
Button("Default") { } | |
// 👎 always blue | |
Button(".accentColor(nil)") { } | |
.accentColor(nil) | |
} | |
.accentColor(.mint) | |
} | |
} | |
} | |
struct ContentView_Previews: PreviewProvider { | |
static var previews: some View { | |
ContentView() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment