CameraAnimationsManager
public class CameraAnimationsManager : CameraAnimationsManagerProtocol
An object that manages a camera’s view lifecycle.
-
List of animators currently alive
Declaration
Swift
public var cameraAnimators: [CameraAnimator] { get }
-
Interrupts all
activeanimation. The camera remains at the last point before the cancel request was invoked, i.e., the camera is not reset or fast-forwarded to the end of the transition. Canceled animations cannot be restarted / resumed. The animator must be recreated.Declaration
Swift
public func cancelAnimations() -
Moves the viewpoint to a different location using a transition animation that evokes powered flight and an optional transition duration and timing function It seamlessly incorporates zooming and panning to help the user find his or her bearings even after traversing a great distance.
Declaration
Swift
@discardableResult public func fly(to camera: CameraOptions, duration: TimeInterval? = nil, completion: AnimationCompletion? = nil) -> Cancelable?Parameters
cameraThe camera options at the end of the animation. Any camera parameters that are nil will not be animated.
durationDuration of the animation, measured in seconds. If nil, a suitable calculated duration is used.
completionCompletion handler called when the animation stops
Return Value
An instance of
Cancelablewhich can be canceled if necessary -
Ease the camera to a destination
Declaration
Swift
@discardableResult public func ease(to camera: CameraOptions, duration: TimeInterval, curve: UIView.AnimationCurve = .easeOut, completion: AnimationCompletion? = nil) -> Cancelable?Parameters
camerathe target camera after animation; if
camera.anchoris non-nil, it is use for both thefromValueand thetoValueof the underlying animation such that the value specified will not be interpolated, but will be passed as-is to each camera update during the animation. To animateanchoritself, use themakeAnimatorAPIs.durationduration of the animation
completioncompletion to be called after animation
Return Value
An instance of
Cancelablewhich can be canceled if necessary
-
Convenience to create a
BasicCameraAnimatorand will add it to a list ofBasicCameraAnimators to track the lifecycle of that animation.NOTE: Keep in mind the lifecycle of a
BasicCameraAnimator. If aBasicCameraAnimatoris destroyed, before the animation is finished, the animation will be interrupted and completion handlers will not be called.Declaration
Swift
public func makeAnimator(duration: TimeInterval, timingParameters parameters: UITimingCurveProvider, animationOwner: AnimationOwner = .unspecified, animations: @escaping (inout CameraTransition) -> Void) -> BasicCameraAnimatorParameters
durationThe duration of the animation, in seconds.
timingParametersThe object providing the timing information. This object must adopt the
UITimingCurveProviderprotocol.animationOwnerProperty that conforms to
AnimationOwnerto represent who owns that animation.Return Value
A class that represents an animator with the provided configuration.
-
Convenience to create a
BasicCameraAnimatorand will add it to a list ofBasicCameraAnimatorto track the lifecycle of that animation.NOTE: Keep in mind the lifecycle of a
BasicCameraAnimator. If aBasicCameraAnimatoris destroyed, before the animation is finished, the animation will be interrupted and completion handlers will not be called.Declaration
Swift
public func makeAnimator(duration: TimeInterval, curve: UIView.AnimationCurve, animationOwner: AnimationOwner = .unspecified, animations: @escaping (inout CameraTransition) -> Void) -> BasicCameraAnimatorParameters
durationThe duration of the animation, in seconds.
curveThe UIKit timing curve to apply to the animation.
animationOwnerProperty that conforms to
AnimationOwnerto represent who owns that animation.animationsThe block containing the animations. This block has no return value and takes no parameters. Use this block to modify any animatable view properties. When you start the animations, those properties are animated from their current values to the new values using the specified animation parameters.
Return Value
A class that represents an animator with the provided configuration.
-
Convenience to create a
BasicCameraAnimatorand will add it to a list ofBasicCameraAnimatorto track the lifecycle of that animation.NOTE: Keep in mind the lifecycle of a
BasicCameraAnimator. If aBasicCameraAnimatoris destroyed, before the animation is finished, the animation will be interrupted and completion handlers will not be called.Declaration
Swift
public func makeAnimator(duration: TimeInterval, controlPoint1 point1: CGPoint, controlPoint2 point2: CGPoint, animationOwner: AnimationOwner = .unspecified, animations: @escaping (inout CameraTransition) -> Void) -> BasicCameraAnimatorParameters
durationThe duration of the animation, in seconds.
controlPoint1The first control point for the cubic Bézier timing curve.
controlPoint2The second control point for the cubic Bézier timing curve.
animationOwnerProperty that conforms to
AnimationOwnerto represent who owns that animation.animationsThe block containing the animations. This block has no return value and takes no parameters. Use this block to modify any animatable view properties. When you start the animations, those properties are animated from their current values to the new values using the specified animation parameters.
Return Value
A class that represents an animator with the provided configuration.
-
Convenience to create a
BasicCameraAnimatorand will add it to a list ofBasicCameraAnimatorto track the lifecycle of that animation.NOTE: Keep in mind the lifecycle of a
BasicCameraAnimator. If aBasicCameraAnimatoris destroyed, before the animation is finished, the animation will be interrupted and completion handlers will not be called.Declaration
Swift
public func makeAnimator(duration: TimeInterval, dampingRatio ratio: CGFloat, animationOwner: AnimationOwner = .unspecified, animations: @escaping (inout CameraTransition) -> Void) -> BasicCameraAnimatorParameters
durationThe duration of the animation, in seconds.
dampingRatioThe damping ratio to apply to the initial acceleration and oscillation. To smoothly decelerate the animation without oscillation, specify a value of 1. Specify values closer to 0 to create less damping and more oscillation.
animationOwnerProperty that conforms to
AnimationOwnerto represent who owns that animation.animationsThe block containing the animations. This block has no return value and takes no parameters. Use this block to modify any animatable view properties. When you start the animations, those properties are animated from their current values to the new values using the specified animation parameters.
Return Value
A class that represents an animator with the provided configuration.
CameraAnimationsManager Class Reference