Initializer

init(rectOf:)

Creates a shape node with a rectangular path centered on the node’s origin.

Declaration

convenience init(rectOf size: CGSize)

Parameters

size

The size of the rectangle.

Return Value

A new shape node.

See Also

Creating a Shape from a Rectangle

init(rect: CGRect)

Creates a shape node with a rectangular path.

init(rect: CGRect, cornerRadius: CGFloat)

Creates a shape with a rectangular path that has rounded corners.

init(rectOf: CGSize, cornerRadius: CGFloat)

Creates a shape with a rectangular path that has rounded corners centered on the node’s position.