Kolos65 / InstagramTransition

Replicating Instagram's gesture-driven shared-element transition using UIKit.
19 stars 0 forks source link

fix: handle rapid swipe gesture edge case #4

Closed Kolos65 closed 4 months ago

Kolos65 commented 4 months ago

On really fast swipe back gestures, the detail screen can become 'stuck' and lose its navigation controller.

This is bacusestartInteractiveTransition(_:) can get called after the pan gesture recognizer called begin and finish in case of a rapid swipe gesture. In these edge cases, we need to finish (or cancel) the transition immediately.

Also, wantsInteractiveStart must be set to false otherwise UIKit will prevent our finish animation from happening as it will pause any animations by default inside startInteractiveTransition if wantsInteractiveStart is true.