ButtonShape
public enum ButtonShape : Equatable
Represents the visual shape of a button used in themed UI components.
This enum defines several commonly used button shapes, including:
- Square: No rounding.
- Rounded: Medium rounding using the theme’s default radius.
- Capsule: Fully rounded pill shape.
- Custom: Developer-defined corner radius.
-
A square button with no corner radius.
Declaration
Swift
case square -
A rounded button using the theme’s medium radius (
ThemeRadii.md).Declaration
Swift
case rounded -
A capsule-shaped button with fully rounded corners (uses
ThemeRadii.pill).Declaration
Swift
case capsule -
A custom shape with a specific corner radius.
Declaration
Swift
case custom(cornerRadius: CGFloat)Parameters
cornerRadiusThe radius in points to use.
-
Resolves the numeric corner radius based on the selected shape and current theme.
Declaration
Swift
public func radius(for theme: Theme) -> CGFloatParameters
themeThe theme from which to pull radius values.
Return Value
A
CGFloatrepresenting the radius to apply. -
Custom equality check that treats any two
.customshapes as equal, regardless of the actual radius value.Declaration
Swift
public static func == (lhs: ButtonShape, rhs: ButtonShape) -> Bool