Skip to content

Commit f7b9dac

Browse files
authored
Disable user interaction during transition (#76)
1 parent 18bf487 commit f7b9dac

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Sources/NavigationTransitions/NavigationTransitionDelegate.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ final class NavigationTransitionAnimatorProvider: NSObject, UIViewControllerAnim
106106

107107
animator.addCompletion { _ in
108108
transitionContext.completeTransition(!transitionContext.transitionWasCancelled)
109+
transitionContext.view(forKey: .from)?.isUserInteractionEnabled = true
110+
transitionContext.view(forKey: .to)?.isUserInteractionEnabled = true
109111
}
110112

111113
return animator
@@ -123,6 +125,9 @@ final class NavigationTransitionAnimatorProvider: NSObject, UIViewControllerAnim
123125
return nil
124126
}
125127

128+
fromUIView.isUserInteractionEnabled = false
129+
toUIView.isUserInteractionEnabled = false
130+
126131
let container = context.containerView
127132
switch operation {
128133
case .push:

0 commit comments

Comments
 (0)