Skip to content

Commit

Permalink
Removing fatal error in method transitionDuration
Browse files Browse the repository at this point in the history
  • Loading branch information
LevinIvan committed Aug 5, 2024
1 parent 29185a4 commit f08c490
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Transitioning.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class ModalPresentTransition: NSObject, UIViewControllerAnimatedTransitioning {
func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval {
guard
let fpc = transitionContext?.viewController(forKey: .to) as? FloatingPanelController
else { fatalError()}
else { return 0.0 }

let animator = fpc.animatorForPresenting(to: fpc.layout.initialState)
return TimeInterval(animator.duration)
Expand Down Expand Up @@ -119,7 +119,7 @@ class ModalDismissTransition: NSObject, UIViewControllerAnimatedTransitioning {
func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval {
guard
let fpc = transitionContext?.viewController(forKey: .from) as? FloatingPanelController
else { fatalError()}
else { return 0.0 }

let animator = fpc.animatorForDismissing(with: .zero)
return TimeInterval(animator.duration)
Expand Down

0 comments on commit f08c490

Please sign in to comment.