Animation
public struct Animation
Statics methods for CAAnimation
-
Animation by changing the opacity
Declaration
Swift
public static func opacity(from fromValue: CGFloat, to toValue: CGFloat) -> CABasicAnimationParameters
fromValuethe initial value of the animation
toValuethe final value of the animation
Return Value
a CABasicAnimation object
-
Animation by changing the scale using transform
Declaration
Swift
public static func transform(from fromValue: CGFloat = 1.0, to toValue: CGFloat) -> CABasicAnimationParameters
fromValuethe initial value of the animation
toValuethe final value o the animation
Return Value
a CABasicAnimation object
-
Animation by changing the color
Declaration
Swift
public static func color(from fromColor: CGColor, to toColor: CGColor) -> CABasicAnimationParameters
fromColorthe initial color of the animation
toColorthe final color of the animation
Return Value
a CABasicAnimation
-
Animation by changing the scale using transform
Declaration
Swift
public static func transform(times: [NSNumber] = [0.0, 0.5, 1.0], values: [CGFloat] = [0.0, 1.4, 1.0], duration: CFTimeInterval = 0.3) -> CAKeyframeAnimationParameters
timesAn array of NSNumber objects that define the time at which to apply a given keyframe segment.
valuesAn array of objects that specify the keyframe values to use for the animation.
durationthe duration of the animation, the default value is 0.3
Return Value
a CAKeyframeAnimation object
-
Animation to hide views, using transform and changing the scale to 0.0
Declaration
Swift
public static func hide() -> CAKeyframeAnimationReturn Value
a CAKeyframeAnimation object
-
Allows multiple animations to be grouped and run concurrently.
Declaration
Swift
public static func group(animations: CAAnimation..., duration: CFTimeInterval) -> CAAnimationGroupParameters
animationsthe list of animations
durationthe animation duration
Return Value
a CAAnimationGroup object
Animation Structure Reference