One Logo Pool Ball
SwiftUI · IOS API REFERENCE

ButtonBorderShape

struct · iOS 15.0+ · SDK 27.1

struct ButtonBorderShape

A shape used to draw a button's border. Use the ``View/buttonBorderShape(_:)`` view modifier to apply the shape to bordered buttons within a view hierarchy.

Members (6)

static · iOS 15.0+

roundedRectangle

TypeScript
static roundedRectangleRadius(radius: number): ButtonBorderShape
Swift declaration
static func roundedRectangle(radius: CGFloat) -> ButtonBorderShape

A rounded rectangle shape. Use the ``View/buttonBorderShape(_:)`` view modifier to apply the shape to bordered buttons within a view hierarchy. - Parameter radius: The corner radius of the rectangle. - Note: This has no effect on non-widget system buttons in macOS.

get · iOS 15.0+

roundedRectangle

TypeScript
static get roundedRectangle(): ButtonBorderShape
Swift declaration
static let roundedRectangle: ButtonBorderShape

A rounded rectangle shape. Use the ``View/buttonBorderShape(_:)`` view modifier to apply the shape to bordered buttons within a view hierarchy.

method · iOS 17.0+

path

TypeScript
path(rect: { x: number; y: number; width: number; height: number }): _SwiftUICore_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.

get · iOS 17.0+

circle

TypeScript
static get circle(): ButtonBorderShape
Swift declaration
static let circle: ButtonBorderShape

A circular shape. Use the ``View/buttonBorderShape(_:)`` view modifier to apply the shape to bordered buttons within a view hierarchy.

get · iOS 15.0+

capsule

TypeScript
static get capsule(): ButtonBorderShape
Swift declaration
static let capsule: ButtonBorderShape

A capsule shape. Use the ``View/buttonBorderShape(_:)`` view modifier to apply the shape to bordered buttons within a view hierarchy. - Note: This has no effect on non-widget system buttons in macOS.

get · iOS 15.0+

automatic

TypeScript
static get automatic(): ButtonBorderShape
Swift declaration
static let automatic: ButtonBorderShape

A shape that defers to the system to determine an appropriate shape for the given context and platform. Use the ``View/buttonBorderShape(_:)`` view modifier to apply the shape to bordered buttons within a view hierarchy.

Skipped declarations

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

ButtonBorderShape.inset(by:)

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

All SwiftUI types →