CALayer

class CALayer : NSObject, NSSecureCoding, CAMediaTiming

Collection of all CALayer Extensions.

Subspec: Extensions/CALayerExtension

  • This accepts paramters that Sketch has, and turns them into the identical shadow on this layer.

    Declaration

    Swift

    func applySketchShadow(color: UIColor,
                           alpha: Float = 1,
                           shadowX: CGFloat = 0,
                           shawdowY: CGFloat = 0,
                           blur: CGFloat,
                           spread: CGFloat = 0)

    Parameters

    color

    the color of the shadow

    alpha

    the alpha of the shadow

    shadowX

    the X-axis offset

    shawdowY

    the Y-axis offset

    blur

    what Sketch calls blur

    spread

    what Sketch calls spread