Initializer

init(rect:cornerRadius:)

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

Declaration

convenience init(rect: CGRect, cornerRadius: CGFloat)

Parameters

rect

A rectangle, relative to the node’s origin.

cornerRadius

The radius of the rounded corners. The radius should not be a negative number. The value should be no larger than half of the rectangle’s width or height, whichever is smaller.

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(rectOf: CGSize)

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

init(rectOf: CGSize, cornerRadius: CGFloat)

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