struct Alignment
Swift
struct Alignment
A point in a box: one horizontal choice and one vertical one.
Two axes in a struct rather than nine cases in an enum, which is what
SwiftUI settled on and for the reason that shows up immediately here: the
nine named corners are combinations, and everything that consumes an
alignment consumes one axis at a time. A row container justifies its main
axis and aligns its cross axis, and asking a nine-case enum for that means
two nine-arm switches that have to stay consistent with each other by
inspection. OverlayAnchor was exactly those two switches, and is now a
spelling of this.
Named corners still read best at a call site, so they stay — as static
members, which pattern-match the same way in an if and compose the way an
enum cannot.
Sources/LavaUI/Alignment.swift:49
Constructors
init(horizontal: HorizontalAlignment, vertical: VerticalAlignment)
Not documented.
Sources/LavaUI/Alignment.swift:53
Properties
static let bottom: Alignment
Not documented.
Sources/LavaUI/Alignment.swift:65
static let bottomLeading: Alignment
Not documented.
Sources/LavaUI/Alignment.swift:64
static let bottomTrailing: Alignment
Not documented.
Sources/LavaUI/Alignment.swift:66
static let center: Alignment
Not documented.
Sources/LavaUI/Alignment.swift:62
var horizontal: HorizontalAlignment
Not documented.
Sources/LavaUI/Alignment.swift:50
static let leading: Alignment
Not documented.
Sources/LavaUI/Alignment.swift:61
static let top: Alignment
Not documented.
Sources/LavaUI/Alignment.swift:59
static let topLeading: Alignment
Not documented.
Sources/LavaUI/Alignment.swift:58
static let topTrailing: Alignment
Not documented.
Sources/LavaUI/Alignment.swift:60
static let trailing: Alignment
Not documented.
Sources/LavaUI/Alignment.swift:63
var vertical: VerticalAlignment
Not documented.
Sources/LavaUI/Alignment.swift:51