<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/geometryGroup()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE13geometryGroupQryF"
  },
  "title" : "geometryGroup()"
}
-->

# geometryGroup()

Isolates the geometry (e.g. position and size) of the view
from its parent view.

```
@export(implementation) nonisolated func geometryGroup() -> some View
```

## Discussion

By default SwiftUI views push position and size changes down
through the view hierarchy, so that only views that draw
something (known as leaf views) apply the current animation to
their frame rectangle. However in some cases this coalescing
behavior can give undesirable results; inserting a geometry
group can correct that. A group acts as a barrier between the
parent view and its subviews, forcing the position and size
values to be resolved and animated by the parent, before being
passed down to each subview.

The example below shows one use of this function: ensuring that
the member views of each row in the stack apply (and animate
as) a single geometric transform from their ancestor view,
rather than letting the effects of the ancestor views be
applied separately to each leaf view. If the members of
`ItemView` may be added and removed at different times the
group ensures that they stay locked together as animations are
applied.

```
VStack {
    ForEach(items) { item in
        ItemView(item: item)
            .geometryGroup()
    }
}
```

Returns: a new view whose geometry is isolated from that of its
parent 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)