One Logo Pool Ball
SwiftUICore · IOS API REFERENCE

Circle

struct · iOS 13.0+ · SDK 27.1

@frozen struct Circle

A circle centered on the frame of the view containing it. The circle's radius equals half the length of the frame rectangle's smallest edge.

Members (5)

method · iOS 16.0+

sizeThatFits

TypeScript
sizeThatFits(proposal: ProposedViewSize): { width: number; height: number }
Swift declaration
nonisolated func sizeThatFits(_ proposal: ProposedViewSize) -> CGSize

Returns the size of the view that will render the shape, given a proposed size. Implement this method to tell the container of the shape how much space the shape needs to render itself, given a size proposal. See ``Layout/sizeThatFits(proposal:subviews:cache:)`` for more details about how the layout system chooses the size of views. - Parameters: - proposal: A size proposal for the container. - Returns: A size that indicates how much space the shape needs.

get · iOS 17.0+

layoutDirectionBehavior

TypeScript
get layoutDirectionBehavior(): LayoutDirectionBehavior
Swift declaration
nonisolated var layoutDirectionBehavior: LayoutDirectionBehavior { get }

Returns the behavior this shape should use for different layout directions. If the layoutDirectionBehavior for a Shape is one that mirrors, the shape's path will be mirrored horizontally when in the specified layout direction. When mirrored, the individual points of the path will be transformed. Defaults to `.mirrors` when deploying on iOS 17.0, macOS 14.0, tvOS 17.0, watchOS 10.0 and later, and to `.fixed` if not. To mirror a path when deploying to earlier releases, either use `View.flipsForRightToLeftLayoutDirection` for a filled or stroked shape or conditionally mirror the points in the path of the shape.

method · iOS 13.0+

path

TypeScript
path(rect: { x: number; y: number; width: number; height: number }): Path
Swift declaration
nonisolated func path(in rect: CGRect) -> Path

Describes this shape as a path within a rectangular frame of reference. - Parameter rect: The frame of reference for describing this shape. - Returns: A path that describes this shape.

method · iOS 26.0+

corners

TypeScript
corners(size?: ({ width: number; height: number }) | null): (RoundedRectangularShapeCorners) | null
Swift declaration
func corners(in size: CGSize?) -> Circle.Corners?

Resolved corners given a size. If the corner style of a shape is size-dependent, read the provided size and return values accordingly. This function could be called with a nil size when the size hasn't been determined. In that case, return the best approximated value. For example, for a capsule shape, its corner radius is determined by the size. If size is not available, return `.fixed(.infinity)` to indicate that the corner should be as round as it could be.

init · iOS 13.0+

init

TypeScript
static init(): Circle
Swift declaration
init()

Creates a new circle shape.

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

Circle.inset(by:)

This protocol needs associated types that cannot yet cross the bridge.

All SwiftUICore types →