Skip to content

Commit

Permalink
Update reduce motion
Browse files Browse the repository at this point in the history
Changelog: improvement
  • Loading branch information
Tomáš Šmerda committed Sep 24, 2024
1 parent 1fa1390 commit 22b762d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# CleevioRouters Changelog

## [2.4.1] - 2024-09-13
## [2.4.2] - 2024-09-13
### Added
- Support for reduce motion.
2 changes: 1 addition & 1 deletion Sources/FlowPilot/ModalNavigationRouter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ open class ModalNavigationRouter: ModalRouter {
}

@objc open override func dismissRouterObjC() {
perform(.dismiss, animated: true)
perform(.dismiss, animated: shouldAnimateDismissRouter())
}

open override func presentationControllerDidDismiss(_ presentationController: UIPresentationController) {
Expand Down
12 changes: 8 additions & 4 deletions Sources/FlowPilot/ModalRouter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,18 @@ open class ModalRouter: NSObject, UIPopoverPresentationControllerDelegate, UIAda

@objc open func dismissRouterObjC() {
dismiss(
animated: shouldAnimateTransition(
preference: configuration?.respectsUserReduceMotion ?? true,
respectsUserReduceMotion: options.contains(.respectsReduceMotionDisabled)
),
animated: shouldAnimateDismissRouter(),
completion: nil
)
}

public func shouldAnimateDismissRouter() -> Bool {
shouldAnimateTransition(
preference: configuration?.respectsUserReduceMotion ?? true,
respectsUserReduceMotion: options.contains(.respectsReduceMotionDisabled)
)
}

@inlinable
open func dismissRouter(animated: Bool, completion: (() -> Void)?) {
dismiss(animated: animated, completion: completion)
Expand Down

0 comments on commit 22b762d

Please sign in to comment.