<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/glassEffectID(_:in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE13glassEffectID_2inQrqd__Sg_AA9NamespaceV0F0VtSHRd__s8SendableRd__lF"
  },
  "title" : "glassEffectID(_:in:)"
}
-->

# glassEffectID(_:in:)

Associates an identity value to Liquid Glass effects defined within
this view.

```
nonisolated func glassEffectID(_ id: (some Hashable & Sendable)?, in namespace: Namespace.ID) -> some View
```

## Discussion

You use this modifier with the [`glassEffect(_:in:)`](/documentation/SwiftUI/View/glassEffect(_:in:))
view modifier and a [`GlassEffectContainer`](/documentation/SwiftUI/GlassEffectContainer) view. When used together,
SwiftUI uses the identifier to animate shapes to and from
each other during transitions.

---

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)