CAGradientLayer

class CAGradientLayer : CALayer
  • Slide a CAGradientLayer in a particular direction.

    Important

    If using group, modify the CAAnimationGroup responsibly. Setting the CAAnimationGroups animations here will overwrite the slide animations.

    Declaration

    Swift

    public func slide(to dir: Direction, group: ((CAAnimationGroup) -> Void) = { _ in })

    Parameters

    dir

    The Direction to slide the CAGradientLayer in.

    group

    A function that takes in and returns a CAAnimationGroup. Useful to modify the CAAnimationGroup that is used to animate the CAGradientLayer. By default, no modifications are made to the corresponding CAAnimationGroup.

  • Stop sliding the CAGradientLayer.

    Declaration

    Swift

    public func stopSliding()