pub enum Transition {
Opacity,
Slide,
Scale {
scale: f64,
anchor: (f64, f64),
},
ScaleWithOpacity {
scale: f64,
anchor: (f64, f64),
},
ScaleDefault,
Identity,
}Expand description
Which transition a view uses when it appears or leaves.
Variants§
Opacity
.opacity — fade.
Slide
.slide — in from the leading edge, out to the trailing.
Scale
.scale(scale:anchor:) — grow from a unit point.
ScaleWithOpacity
.scale(…).combined(with: .opacity) — the pair SwiftUI’s own
.scale transitions are usually written with, since scaling from
nothing without fading looks like a pop.
ScaleDefault
.scale — the bare static property, which is Scale with SwiftUI’s
own factor and anchor rather than ones given here.
Identity
.identity — no transition, and not the same as no modifier: this
overrides one a container would otherwise hand down.
Trait Implementations§
Source§impl Clone for Transition
impl Clone for Transition
impl Copy for Transition
Source§impl Debug for Transition
impl Debug for Transition
Source§impl PartialEq for Transition
impl PartialEq for Transition
impl StructuralPartialEq for Transition
Auto Trait Implementations§
impl Freeze for Transition
impl RefUnwindSafe for Transition
impl Send for Transition
impl Sync for Transition
impl Unpin for Transition
impl UnsafeUnpin for Transition
impl UnwindSafe for Transition
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more