FormsTransitions helper
import FormsTransitions
FormsUtils.framework
All views has additional viewKey, viewOptions and viewContentMode properties. View can be interpolated between screens.
view.viewKey = "contentView"
view.viewOptions = []
view.viewContentMode = .scaleToFill
enum TransitionOption {
case leaveRootInSource
case leaveRootInDestination
case leaveRoot
case skipInSource
case skipInDestination
case skip
case moveSource
case moveDestination
case forceMatch
}
Presented controller must have custom presentation style and set transitioning delegate
controller.modalPresentationStyle = .custom
controller.transitioningDelegate = coordinator
If presented controller conform TransitionableController protocol, views between presenting and presented controllers would be interpolated.
Animators
TransitionControllerSlideHorizontalAnimator
TransitionControllerSlideVerticalAnimator
Handle swipe to back interactively
...
self.edgePanGesture.addTarget(self, action: #selector(handleTransitionBackSwipe))
self.edgePanGesture.edges = .left
self.view.addGestureRecognizer(self.edgePanGesture)
...
@objc
func handleTransitionBackSwipe(recognizer: UIScreenEdgePanGestureRecognizer) {
self.handleTransitionControllerEdgePan(recognizer)
}
Navigation controller must have custom delegate
controller.delegate = coordinator
If navigation controller conform TransitionableNavigation protocol, views between controllers would be interpolated.
Animators
TransitionNavigationSlideHorizontalAnimator
TransitionNavigationSlideVerticalAnimator
TransitionNavigationFadeAnimator
Handle swipe to back interactively
...
self.edgePanGesture.addTarget(self, action: #selector(handleTransitionBackSwipe))
self.edgePanGesture.edges = .left
self.view.addGestureRecognizer(self.edgePanGesture)
...
@objc
func handleTransitionBackSwipe(recognizer: UIScreenEdgePanGestureRecognizer) {
self.handleTransitionNavigationEdgePan(recognizer)
}