A rectangular shape aligned inside the frame of the view containing it.
Members (4)
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.
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.
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(): Rectangle
Swift declaration
init()
Creates a new rectangle shape.
Skipped declarations
1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.
Rectangle.inset(by:)
This protocol needs associated types that cannot yet cross the bridge.