Contents

init(roundedRect:cornerRadius:style:)

Creates a path containing a rounded rectangle.

Declaration

init(roundedRect rect: CGRect, cornerRadius: CGFloat, style: RoundedCornerStyle = .continuous)

Parameters

  • rect:

    A rectangle, specified in user space coordinates.

  • cornerRadius:

    The radius of all corners of the rectangle, specified in user space coordinates.

  • style:

    The corner style. Defaults to the continous style if not specified.

Discussion

This is a convenience function that creates a path of a rounded rectangle. Using this convenience function is more efficient than creating a path and adding a rounded rectangle to it.

See Also

Creating a path