Transition Plugin
The TransitionPlugin allows for specifying transitions for when Player loads a flow, and for transition between views in the same flow.
CocoaPods
Add the subspec to your Podfile.
pod 'PlayerUI/TransitionPlugin'In your Swift file, import the pod. Only one import is needed for all PlayerUI pods.
import PlayerUISwift Package Manager
Add the product to the appropriate target's dependencies in your Package.swift.
.target( name: "MyApp", dependencies: [ .product(name: "PlayerUITransitionPlugin", package: "playerui-swift-package"), ])In your Swift file, import the sub-package. A different import is needed for each PlayerUI sub-package.
import PlayerUITransitionPluginSwift Usage
Section titled “Swift Usage”SwiftUIPlayer(flow: flowString, plugins: [TransitionPlugin(popTransition: .pop)], result: $resultBinding)Customizing Transitions
Section titled “Customizing Transitions”To specify different transition, just supply a PlayerViewTransition to the plugin initializer:
let customTransition = PlayerViewTransition( transition: AnyTransition.opacity, animationCurve: Animation.linear)let plugin = TransitionPlugin( stateTransition: customTransition, pushTransition: customTransition, popTransition: customTransition)Default Transitions
Section titled “Default Transitions”By default there are 5 transitions included with the SwiftUIPlayer:
/// Transition that slides views in from the trailing edge and out from to the leading edge of the screenPlayerViewTransition.slideInSlideOut
/// Transition that slides views in from the trailing edge and fades out views on removalPlayerViewTransition.slideInFadeOut
/// Transition that fades views in and slides out to the leading edge of the screen on removalPlayerViewTransition.fadeInSlideOut
/// Transition that slides views in from the trailing edge and out from to the leading edge of the screenPlayerViewTransition.push
/// Transition that slides views in from the leading edge and out from to the trailing edge of the screenPlayerViewTransition.pop