SpiralAnimationConfig

@objcMembers
@objc(GSSpiralAnimationConfig)
public class SpiralAnimationConfig : NSObject, AnimationConfig

Spiral animation configuration class.

Allows to configure the following parameters for this animation:

  • speed: animation execution speed, in meters per second. If with(speed:) is not customized, then the drone will apply its own default value for this parameter.
  • radius variation: animation radius variation. If with(radiusVariation:) is not customized, then the drone will apply its own default value for this parameter.
  • vertical distance: distance the drone will fly vertically, in meters. Positive values instruct the drone to fly up, negative value instructs to fly down. If with(verticalDistance:) is not customized, then the drone will apply its own default value for this parameter.
  • revolution number: number of revolutions the drone will perform around the target. Positive values instruct the drone to circle clockwise, negative values instruct to circle counter-clockwise. If with(revolutionAmount:) is not customized, then the drone will apply its own default value for this parameter.
  • mode: animation execution mode. If with(mode:) is not customized, then the drone will apply its own default value for this parameter: .once.
  • Declaration

    Swift

    public let type: AnimationType
  • Custom speed, in meters per second. Value is nil if with(speed:) has never been called.

    Declaration

    Swift

    public private(set) var speed: Double? { get }
  • Desired relative radius variation. Value is nil if with(radiusVariation:) has never been called. A value of 2 means that the ending radius will be twice as big as the starting radius. A value of -2 means that the ending radius will half of the size of the starting radius. A value of 1 means that the radius will not change during the animation.

    Declaration

    Swift

    public private(set) var radiusVariation: Double? { get }
  • Custom vertical distance, in meters. Value is nil if with(verticalDistance:) has never been called. If negative, the spiral will be directed to the ground.

    Declaration

    Swift

    public private(set) var verticalDistance: Double? { get }
  • Revolution amount, the number of revolution (in turn). Value is nil if with(revolutionAmount:) has never been called. Positive value makes a clockwise spiral, negative is anti-clockwise.

    Declaration

    Swift

    public private(set) var revolutionAmount: Double? { get }
  • Custom execution mode. Value is nil if with(mode:) has never been called.

    Declaration

    Swift

    public private(set) var mode: AnimationMode? { get }
  • Configures a custom animation speed.

    Declaration

    Swift

    @discardableResult
    public func with(speed: Double) -> SpiralAnimationConfig

    Parameters

    speed

    custom animation speed, in meters per second

    Return Value

    self, to allow call chaining

  • Configures a custom radius variation.

    Declaration

    Swift

    @discardableResult
    public func with(radiusVariation: Double) -> SpiralAnimationConfig

    Parameters

    radiusVariation

    custom radius variation

    Return Value

    self, to allow call chaining

  • Configures a custom animation vertical distance.

    Declaration

    Swift

    @discardableResult
    public func with(verticalDistance: Double) -> SpiralAnimationConfig

    Parameters

    verticalDistance

    custom vertical distance, in meters

    Return Value

    self, to allow call chaining

  • Configures a custom animation revolution amount.

    Declaration

    Swift

    @discardableResult
    public func with(revolutionAmount: Double) -> SpiralAnimationConfig

    Parameters

    revolutionAmount

    custom revolution amount

    Return Value

    self, to allow call chaining

  • Configures a custom animation execution mode.

    Declaration

    Swift

    @discardableResult
    public func with(mode: AnimationMode) -> SpiralAnimationConfig

    Parameters

    mode

    custom execution mode

    Return Value

    self, to allow call chaining

  • true when with(mode:) has been called once. ObjC-only api. In Swift, use mode.

    Declaration

    Swift

    public var modeIsCustom: Bool { get }
  • Custom mode. Value is meaningless if modeIsCustom is false. ObjC-only api. In Swift, use mode.

    Declaration

    Swift

    public var customMode: AnimationMode { get }