TransitionContainer
public struct TransitionContainer : Element
Wraps a content element and adds transitions when the element appears, disappears, or changes layout.
-
The transition to apply when the wrapped element is appearing.
Declaration
Swift
public var appearingTransition: VisibilityTransition?
-
The transition to apply when the wrapped element is disappearing.
Declaration
Swift
public var disappearingTransition: VisibilityTransition?
-
The transition to apply when the wrapped element’s layout is changing.
Declaration
Swift
public var layoutTransition: LayoutTransition
-
The element to which transitions are being applied.
Declaration
Swift
public var wrappedElement: Element
-
Create a transition container wrapping an element.
The created container’s default transitions are:
appearingTransition
:fade
disappearingTransition
:fade
layoutTransition
:.specific(AnimationAttributes())
Declaration
Swift
@available(*, deprecated, message: "Use TransitionContainer(transitioning:﹚, which has better defaults") public init(wrapping element: Element)
Parameters
wrapping
The element to which transitions will be applied.
-
Create a transition container wrapping an element.
Declaration
Swift
public init( appearingTransition: VisibilityTransition? = nil, disappearingTransition: VisibilityTransition? = nil, layoutTransition: LayoutTransition = .inherited, transitioning element: Element )
Parameters
appearingTransition
The transition to use when the element appears. By default, no transition.
disappearingTransition
The transition to use when the element disappears. By default, no transition.
layoutTransition
The transition to use when the element’s layout changes. The default value is
.inherited
, which means the element will participate in the same transition as its nearest ancestor with a specified transition.transitioning
The element to which transitions will be applied.
-
Declaration
Swift
public var content: ElementContent { get }
-
Declaration
Swift
public func backingViewDescription(with context: ViewDescriptionContext) -> ViewDescription?