Created
April 26, 2022 17:51
-
-
Save andresr-dev/7e0b9eb106a043f2cf26f7b34cc74e7d to your computer and use it in GitHub Desktop.
This is an example of how you support reduce transparency accessibility in your applications
This file contains hidden or 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 ReduceTransparencyExample: View { | |
| @Environment(\.accessibilityReduceTransparency) var reduceTransparency | |
| var body: some View { | |
| Text("Hello, World!") | |
| .padding() | |
| .background(reduceTransparency ? .black : .black.opacity(0.5)) | |
| .foregroundColor(.white) | |
| .clipShape(Capsule()) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment