Class

CAShapeLayer

A layer that draws a cubic Bezier spline in its coordinate space.

Declaration

@interface CAShapeLayer : CALayer

Overview

The shape is composited between the layer's contents and its first sublayer.

The shape will be drawn antialiased, and whenever possible it will be mapped into screen space before being rasterized to preserve resolution independence. However, certain kinds of image processing operations, such as CoreImage filters, applied to the layer or its ancestors may force rasterization in a local coordinate space.

Topics

Specifying the Shape Path

path

The path defining the shape to be rendered. Animatable.

Accessing Shape Style Properties

fillColor

The color used to fill the shape’s path. Animatable.

fillRule

The fill rule used when filling the shape’s path.

lineCap

Specifies the line cap style for the shape’s path.

lineDashPattern

The dash pattern applied to the shape’s path when stroked.

lineDashPhase

The dash phase applied to the shape’s path when stroked. Animatable.

lineJoin

Specifies the line join style for the shape’s path.

lineWidth

Specifies the line width of the shape’s path. Animatable.

miterLimit

The miter limit used when stroking the shape’s path. Animatable.

strokeColor

The color used to stroke the shape’s path. Animatable.

strokeStart

The relative location at which to begin stroking the path. Animatable.

strokeEnd

The relative location at which to stop stroking the path. Animatable.

Constants

Shape Fill Mode Values

These constants specify the possible fill modes for fillRule.

Line Join Values

These constants specify the shape of the joints between connected segments of a stroked path. Used by lineJoin. Figure 1 shows the appearance of the line join styles.

Line Cap Values

These constants specify the shape of endpoints for an open path when stroked. Used by lineCap. Figure 1 shows the appearance of the line cap styles.

Relationships

Inherits From

See Also

Text, Shapes, and Gradients

CATextLayer

A layer that provides simple text layout and rendering of plain or attributed strings.

CAGradientLayer

A layer that draws a color gradient over its background color, filling the shape of the layer (including rounded corners)

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software