ContentTransition

A kind of transition that applies to the content within a single view, rather than to the insertion or removal of a view.

StructureiOS 16.0+macOS 13.0+tvOS 16.0+watchOS 9.0+ContentTransition in SwiftUI

Declaration

React
type ContentTransition =
  | 'identity'
  | 'interpolate'
  | 'opacity'
  | 'symbolEffect'
  | { numericText: { countsDown?: boolean; }; }
  | { numericText: { value: number; }; };
Swift
struct ContentTransition

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

Type properties

  • 'identity'SwiftUI.ContentTransition.identity

    The identity content transition, which indicates that content changes shouldn't animate.

  • 'interpolate'SwiftUI.ContentTransition.interpolate

    A content transition that indicates the views attempt to interpolate their contents during transitions, where appropriate.

  • 'opacity'SwiftUI.ContentTransition.opacity

    A content transition that indicates content fades from transparent to opaque on insertion, and from opaque to transparent on removal.

  • 'symbolEffect'SwiftUI.ContentTransition.symbolEffect

    A content transition that applies the default symbol effect transition to symbol images within the inserted or removed view hierarchy. Other views are unaffected by this transition.

Type methods

Overview

Set the behavior of content transitions within a view with the View.contentTransition(_:) modifier, passing in one of the defined transitions, such as opacity or interpolate as the parameter.

an Animation to the views inside the View.contentTransition(_:) modifier.

Content transitions only take effect within the context of an Animation block.

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

Used by

See also

More in Animation.