AnyTransition

A type-erased transition.

StructureiOS 13.0+macOS 10.15+tvOS 13.0+watchOS 6.0+AnyTransition in SwiftUI

Declaration

React
type AnyTransition =
  | 'identity'
  | 'opacity'
  | 'scale'
  | 'slide'
  | { asymmetric: { insertion: AnyTransition; removal: AnyTransition; }; }
  | { move: { edge: Edge; }; }
  | { offset: { x?: number; y?: number; }; }
  | { offset: CGSize; }
  | { push: { from: Edge; }; }
  | { scale: { scale: number; anchor?: UnitPoint; }; }
  | AnyTransitionChain;
Swift
@frozen struct AnyTransition

Pass a literal, or build one with SwiftUI.AnyTransition from import { SwiftUI } from 'swiftui-react-native'.

Type properties

  • 'identity'SwiftUI.AnyTransition.identity

    A transition that returns the input view, unmodified, as the output view.

  • 'opacity'SwiftUI.AnyTransition.opacity

    A transition from transparent to opaque on insertion, and from opaque to transparent on removal.

  • Returns a transition that scales the view.

  • A transition that inserts by moving in from the leading edge, and removes by moving out towards the trailing edge.

Type methods

Overview

From Apple’s SwiftUI documentation. Code samples there are Swift.

Used by

See also

More in Animation.