Created
August 4, 2024 14:02
-
-
Save robinkanatzar/127abf4ca28347d66e38041e9611f004 to your computer and use it in GitHub Desktop.
Accessibility + visionOS: Observe reduced motion system setting
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 | |
/// An example view that listens to the user's system settings | |
/// about preferring motion | |
struct ReducedMotionView: View { | |
@Environment(\.accessibilityReduceMotion) | |
private var accessibilityReduceMotion | |
var body: some View { | |
if accessibilityReduceMotion { | |
Text("User does NOT like motion... 🤮") | |
} else { | |
Text("User is ok with things that move.") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment