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

# DebugReplaceableView

Erases view opaque result types in debug builds.

```
nonisolated struct DebugReplaceableView
```

## Overview

You don’t use this type directly. Instead SwiftUI creates this type on
your behalf when building in debug mode.

When in debug builds, SwiftUI will erase all opaque result types to
`DebugReplaceableView`. This allows developer tools, such as Xcode Previews,
to replace the definition of the view without fully rebuilding.

As such, seeing this type in traces and the view debugger is expected when
building for debugging. This type erasure can impact performance, especially
when dealing with dynamic content (like content generated by a ForEach, or
List) so any performance testing should be done in release mode.

This type acts similarly to an `AnyView` in that it type-erases its content,
however it depends on the underlying type of the value not actually changing
as it is in place of an opaque result type. As such, it *should not be used
in app code*.

## Relationships

### Conforms To

[`View`](/documentation/SwiftUI/View)

---

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)