ShapeLayer

public class ShapeLayer: CAShapeLayer

Extension for CAShapeLayer that allows overriding the actions for specific properties.

  • A boolean value that, when true, prevents the animation of a shape’s properties.

    ShapeLayer.disableActions = true
    circle.fillColor = red
    ShapeLayer.disableActions = false
    
    This value can be set globally, after which changes to any shape's properties will be immediate.
    

    Declaration

    Swift

    public static var disableActions = true
  • This method searches for the given action object of the layer. Actions define dynamic behaviors for a layer. For example, the animatable properties of a layer typically have corresponding action objects to initiate the actual animations. When that property changes, the layer looks for the action object associated with the property name and executes it. You can also associate custom action objects with your layer to implement app-specific actions.

    Declaration

    Swift

    public override func actionForKey(key: String) -> CAAction?

    Parameters

    key

    The identifier of the action.

    Return Value

    the action object assigned to the specified key.

  • The value of the receiver’s current rotation state. This value is cumulative, and can represent values beyong +/- π

    Declaration

    Swift

    public dynamic var rotation: Double
  • Initializes a new C4Layer

    Declaration

    Swift

    public override init()
  • Initializes a new C4Layer from a specified layer of any other type. - parameter layer: Another CALayer

    Declaration

    Swift

    public override init(layer: AnyObject)

    Parameters

    layer

    Another CALayer

  • Initializes a new C4Layer from data in a given unarchiver. - parameter coder: An unarchiver object.

    Declaration

    Swift

    public required init?(coder: NSCoder)

    Parameters

    coder

    An unarchiver object.

  • Sets a value for a given key. - parameter value: The value for the property identified by key. - parameter key: The name of one of the receiver’s properties

    Declaration

    Swift

    public override func setValue(value: AnyObject?, forKey key: String)

    Parameters

    value

    The value for the property identified by key.

    key

    The name of one of the receiver’s properties

  • Returns a Boolean indicating whether changes to the specified key require the layer to be redisplayed. - parameter key: A string that specifies an attribute of the layer. - returns: A Boolean indicating whether changes to the specified key require the layer to be redisplayed.

    Declaration

    Swift

    public override class func needsDisplayForKey(key: String) -> Bool

    Parameters

    key

    A string that specifies an attribute of the layer.

    Return Value

    A Boolean indicating whether changes to the specified key require the layer to be redisplayed.

  • Reloads the content of this layer. Do not call this method directly.

    Declaration

    Swift

    public override func display()