<!--
{
  "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/glassEffectUnion(id:namespace:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE16glassEffectUnion2id9namespaceQrqd__Sg_AA9NamespaceV2IDVtSHRd__lF"
  },
  "title" : "glassEffectUnion(id:namespace:)"
}
-->

# glassEffectUnion(id:namespace:)

Associates any Liquid Glass effects defined within this view
to a union with the provided identifier.

```
@MainActor @preconcurrency func glassEffectUnion(id: (some Hashable & Sendable)?, namespace: Namespace.ID) -> some View
```

## Discussion

You may want the geometries of multiple views to contribute to
a single Liquid Glass effect shape. In these cases, you can use a
[`glassEffectUnion(id:namespace:)`](/documentation/SwiftUI/View/glassEffectUnion(id:namespace:)) to specify that
a view should contribute to a union of Liquid Glass effects with
a particular identifier. All Liquid Glass effects with the same
shape and Liquid Glass variant will be combined into a single shape.

---

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)