<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/AnyTransition",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI13AnyTransitionV"
  },
  "title" : "AnyTransition"
}
-->

# AnyTransition

A type-erased transition.

```
@frozen struct AnyTransition
```

## Overview

- See Also: `Transition`

## Topics

### Getting built-in transitions

[`identity`](/documentation/SwiftUI/AnyTransition/identity)

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

[`move(edge:)`](/documentation/SwiftUI/AnyTransition/move(edge:))

Returns a transition that moves the view away, towards the specified
edge of the view.

[`offset(_:)`](/documentation/SwiftUI/AnyTransition/offset(_:))

[`offset(x:y:)`](/documentation/SwiftUI/AnyTransition/offset(x:y:))

[`opacity`](/documentation/SwiftUI/AnyTransition/opacity)

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

[`push(from:)`](/documentation/SwiftUI/AnyTransition/push(from:))

Creates a transition that when added to a view will animate the
view’s insertion by moving it in from the specified edge while
fading it in, and animate its removal by moving it out towards
the opposite edge and fading it out.

[`scale`](/documentation/SwiftUI/AnyTransition/scale)

Returns a transition that scales the view.

[`scale(scale:anchor:)`](/documentation/SwiftUI/AnyTransition/scale(scale:anchor:))

Returns a transition that scales the view by the specified amount.

[`slide`](/documentation/SwiftUI/AnyTransition/slide)

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

### Combining and configuring transitions

[`animation(_:)`](/documentation/SwiftUI/AnyTransition/animation(_:))

Attaches an animation to this transition.

[`asymmetric(insertion:removal:)`](/documentation/SwiftUI/AnyTransition/asymmetric(insertion:removal:))

Provides a composite transition that uses a different transition for
insertion versus removal.

[`combined(with:)`](/documentation/SwiftUI/AnyTransition/combined(with:))

Combines this transition with another, returning a new transition that
is the result of both transitions being applied.

### Creating a custom transition

[`init(_:)`](/documentation/SwiftUI/AnyTransition/init(_:))

Create an instance that type-erases `transition`.

[`modifier(active:identity:)`](/documentation/SwiftUI/AnyTransition/modifier(active:identity:))

Returns a transition defined between an active modifier and an identity
modifier.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)