mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Handle cancel of swipe animation better
This commit is contained in:
parent
c12cf4d5bc
commit
250f78c3f3
1 changed files with 7 additions and 5 deletions
|
|
@ -45,12 +45,14 @@ extension SlideAnimatedTransitioning: UIViewControllerAnimatedTransitioning {
|
|||
fromVC.view?.layer.shadowOpacity = 0.1
|
||||
|
||||
}, completion: { _ in
|
||||
toVC.view?.layer.opacity = 1.0
|
||||
toVC.view?.layer.shadowOpacity = 0
|
||||
fromVC.view?.layer.opacity = 1.0
|
||||
fromVC.view?.layer.shadowOpacity = 0
|
||||
if !transitionContext.transitionWasCancelled {
|
||||
toVC.view?.layer.opacity = 1.0
|
||||
toVC.view?.layer.shadowOpacity = 0
|
||||
fromVC.view?.layer.opacity = 1.0
|
||||
fromVC.view?.layer.shadowOpacity = 0
|
||||
|
||||
fromVC.view.removeFromSuperview()
|
||||
fromVC.view.removeFromSuperview()
|
||||
}
|
||||
// when cancelling or completing the animation, ios simulator seems to sometimes flash black backgrounds during the animation. on devices, this doesn't seem to happen though.
|
||||
// containerView.backgroundColor = [UIColor whiteColor];
|
||||
transitionContext.completeTransition(!transitionContext.transitionWasCancelled)
|
||||
|
|
|
|||
Loading…
Reference in a new issue