SwiftUIStarterKit Documentation

Extensions on View

Methods

depending(on​Whether:​apply:​or:​)

@ViewBuilder
    public func depending<ModifierIfTrue, ModifierIfFalse>(
        onWhether condition: Bool,
        apply modifierIfTrue: ModifierIfTrue,
        or modifierIfFalse: ModifierIfFalse
    ) -> some View where
        ModifierIfTrue: ViewModifier,
        ModifierIfFalse: ViewModifier

Conditionally applies a modifier to a view, based upon the truthiness of a Boolean.

centered(_:​)

public func centered(
        _ alignmentKind: CenteredViewModifier.AlignmentKind
    ) -> some View  

rounded​Border(_:​line​Width:​corner​Radius:​applies​Clipping:​)

public func roundedBorder<BorderStyle>(
        _ content: BorderStyle,
        lineWidth: Double = 1.0,
        cornerRadius: Double,
        appliesClipping: Bool = false
    ) -> some View
        where BorderStyle: ShapeStyle

reading​Max​Width(_:​)

public func readingMaxWidth(_ newWidthHandler: @escaping (CGFloat) -> Void) -> some View  

reading​Frame​Size(_:​)

public func readingFrameSize(_ newSizeHandler: @escaping (CGSize) -> Void) -> some View