Reduced animations - SwiftUI
In SwiftUI, you can read the UIAccessibility.isReduceMotionEnabled
property. If the value is true
, you could choose to disable (non-essential) animations of your views. You can do this, for example, with the transaction
modifier by setting the value of disabledAnimations
to true
or to the value of UIAccessibility.isReduceMotionEnabled
.
Note: For the changes to take effect, you need to reload the view or setup a listener for reduceMotionStatusDidChangeNotification
AnimatedView()
.transaction { $0.disablesAnimations = UIAccessibility.isReduceMotionEnabled }