struct Transition
Swift
struct Transition
How a view animates as it appears and disappears.
Value animation (Animated<T>) covers a property changing on a node that
stays put. A transition is the other half: the node itself arriving or
leaving. Leaving is the hard direction — by the time a reconciler knows a
child is gone, the view describing it no longer exists, so the node has to
outlive its own removal. That is what FragmentNode.departingChildren is
for, and it is why this touches the three reconcilers that drop nodes rather
than living entirely in a modifier.
Sources/LavaUI/Transition.swift:12
Constructors
init(fades: Bool = true, offsetX: Float = 0, offsetY: Float = 0, duration: Double = 0.18, curve: AnimationCurve = .easeOut)
Not documented.
Sources/LavaUI/Transition.swift:21
Properties
var curve: AnimationCurve
Not documented.
Sources/LavaUI/Transition.swift:19
var duration: Double
Not documented.
Sources/LavaUI/Transition.swift:18
var fades: Bool
Fade between transparent and opaque.
Sources/LavaUI/Transition.swift:14
var offsetX: Float
Where the view comes from and returns to, relative to its final place.
Sources/LavaUI/Transition.swift:16
var offsetY: Float
Not documented.
Sources/LavaUI/Transition.swift:17
static let opacity: Transition
Not documented.
Sources/LavaUI/Transition.swift:35
Methods
static func slide(dx: Float = 0, dy: Float = -8) -> Transition
Slides in from dy above (negative) or below (positive), fading.
Sources/LavaUI/Transition.swift:38