<!--
{
  "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/EmptyModifier",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI13EmptyModifierV"
  },
  "title" : "EmptyModifier"
}
-->

# EmptyModifier

An empty, or identity, modifier, used during development to switch
modifiers at compile time.

```
@frozen nonisolated struct EmptyModifier
```

## Overview

Use the empty modifier to switch modifiers at compile time during
development. In the example below, in a debug build the [`Text`](/documentation/SwiftUI/Text)
view inside `ContentView` has a yellow background and a red border.
A non-debug build reflects the default system, or container supplied
appearance.

```
struct EmphasizedLayout: ViewModifier {
    func body(content: Content) -> some View {
        content
            .background(Color.yellow)
            .border(Color.red)
    }
}

struct ContentView: View {
    var body: some View {
        Text("Hello, World!")
            .modifier(modifier)
    }

    var modifier: some ViewModifier {
        #if DEBUG
            return EmphasizedLayout()
        #else
            return EmptyModifier()
        #endif
    }
}
```

## Topics

### Creating an empty modifier

[`init()`](/documentation/SwiftUI/EmptyModifier/init())

### Getting the identity modifier

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

## Relationships

### Conforms To

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

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

[`Sendable`](/documentation/Swift/Sendable)

[`Copyable`](/documentation/Swift/Copyable)

[`Escapable`](/documentation/Swift/Escapable)

---

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)