Skip to content

Commit

Permalink
Replace PR #551 change using fatalError()
Browse files Browse the repository at this point in the history
  • Loading branch information
scenee committed Sep 6, 2022
1 parent aef914e commit 8ab3c11
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sources/Transitioning.swift
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ class ModalPresentTransition: NSObject, UIViewControllerAnimatedTransitioning {
return animator
}

// Ensure the current(initial) state is hidden. Because `fpc.transitionAnimator` can be nil if not.
fpc.move(to: .hidden, animated: false)

fpc.suspendTransitionAnimator(true)
fpc.show(animated: true) { [weak fpc] in
fpc?.suspendTransitionAnimator(false)
transitionContext.completeTransition(!transitionContext.transitionWasCancelled)
}
return fpc.transitionAnimator!
guard let transitionAnimator = fpc.transitionAnimator else {
fatalError("The panel state must be `hidden` but it is `\(fpc.state)`")
}
return transitionAnimator
}

func animateTransition(using transitionContext: UIViewControllerContextTransitioning) {
Expand Down

0 comments on commit 8ab3c11

Please sign in to comment.