Skip to content

Instantly share code, notes, and snippets.

@andresr-dev
Created April 26, 2022 17:51
Show Gist options
  • Select an option

  • Save andresr-dev/7e0b9eb106a043f2cf26f7b34cc74e7d to your computer and use it in GitHub Desktop.

Select an option

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
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