Class

CATextLayer

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

Overview

The first line is aligned to the top of the layer.

Topics

Getting and Setting the Text

var string: Any?

The text to be rendered by the receiver.

Text Visual Properties

var font: CFTypeRef?

The font used to render the receiver’s text.

var fontSize: CGFloat

The font size used to render the receiver’s text. Animatable.

var foregroundColor: CGColor?

The color used to render the receiver’s text. Animatable.

Text Alignment and Truncation

var isWrapped: Bool

Determines whether the text is wrapped to fit within the receiver’s bounds.

var alignmentMode: String

Determines how individual lines of text are horizontally aligned within the receiver’s bounds.

var truncationMode: String

Determines how the text is truncated to fit within the receiver’s bounds.

Constants

Truncation modes

These constants are used by the truncationMode property.

Horizontal alignment modes

These constants are used by the alignmentMode property.

Instance Properties

var allowsFontSubpixelQuantization: Bool

Sets whether or not to allow subpixel quantization for the graphics context used for text rendering.

Relationships

Inherits From

Conforms To

See Also

Text, Shapes, and Gradients

class CAShapeLayer

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

class CAGradientLayer

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