CAGradientLayer
class CAGradientLayer : CALayer
-
Slide a
CAGradientLayer
in a particular direction.Important
If using
group
, modify theCAAnimationGroup
responsibly. Setting theCAAnimationGroup
sanimations
here will overwrite the slide animations.Declaration
Swift
public func slide(to dir: Direction, group: ((CAAnimationGroup) -> Void) = { _ in })
Parameters
dir
The
Direction
to slide theCAGradientLayer
in.group
A function that takes in and returns a
CAAnimationGroup
. Useful to modify theCAAnimationGroup
that is used to animate theCAGradientLayer
. By default, no modifications are made to the correspondingCAAnimationGroup
. -
Stop sliding the
CAGradientLayer
.Declaration
Swift
public func stopSliding()