Conform to UIAccessibility.isReduceMotionEnabled

This commit is contained in:
Stefan Ceriu
2023-09-20 14:46:56 +03:00
committed by Stefan Ceriu
parent 29bcc5371a
commit bba3fab31d
2 changed files with 11 additions and 2 deletions
@@ -181,8 +181,17 @@ class TimelineTableViewController: UIViewController {
// We only animate when there's a new last message, so its safe
// to animate from the bottom (which is the top as we're flipped).
dataSource?.defaultRowAnimation = .top
dataSource?.defaultRowAnimation = (UIAccessibility.isReduceMotionEnabled ? .none : .top)
tableView.delegate = self
NotificationCenter.default.addObserver(self,
selector: #selector(accessibilityReduceMotionDidChange),
name: UIAccessibility.reduceMotionStatusDidChangeNotification,
object: nil)
}
@objc private func accessibilityReduceMotionDidChange() {
dataSource?.defaultRowAnimation = (UIAccessibility.isReduceMotionEnabled ? .none : .top)
}
/// Updates the table view with the latest items from the ``timelineItems`` array. After