RoundedRectangularShape
A protocol of InsettableShape that describes a rounded rectangular shape.
Declaration
type RoundedRectangularShape =
| Capsule
| Circle
| Rectangle
| RoundedRectangle
| UnevenRoundedRectangle;protocol RoundedRectangularShape : InsettableShapeOverview
Conform your InsettableShape type to RoundedRectangularShape when
your shape is a rounded rectangular with four corners and you want to expose
information about the corners. For example, a custom triangle Shape is
not fit for such conformance, while a custom rectangle Shape could
benefit from providing the implementation, especially when the shape is used
as a container shape in
View.containerShape(_:)-(RoundedRectangularShape) to achieve
concentricity.
System shapes like Rectangle, RoundedRectangle,
UnevenRoundedRectangle, Capsule, and Circle already provide
default implementation for this protocol.
From Apple’s SwiftUI documentation. Code samples there are Swift.
Used by
See also
More in Drawing and shapes.
- AngleA geometric angle whose value you access in either radians or degrees.
- AngularGradientAn angular gradient.
- AnyGradientA color gradient.
- BlendModeModes for compositing a view with overlapping content.
- ButtonBorderShapeA shape used to draw a button's border.
- ColorMatrixA matrix to use in an RGBA color transformation.
- ConcentricRectangleAnimatableDataThe type defining the data to animate.
- ContainerRelativeShapeA shape that is replaced by an inset version of the current container shape. If no container shape was defined, is replaced by a rectangle.
- ContentShapeKindsA kind for the content shape of a view.
- CoordinateSpaceProtocolA frame of reference within the layout system.
- DefaultGlassEffectShapeThe default shape applied by glass effects, a capsule.
- EllipticalGradientA radial gradient that draws an ellipse.