Modifiers
geometryGroup
Isolates the geometry (e.g. position and size) of the view from its parent view.
geometryGroup()
iOS 17+
Isolates the geometry (e.g. position and size) of the view from its parent view.
Returns: ModifierConfig
See: Official SwiftUI documentation.
Example
<VStack modifiers={[animation(Animation.spring(), isBusy)]}>
{isBusy ? <Text>Working…</Text> : null}
<Button label="Check now" modifiers={[geometryGroup()]} />
</VStack>Works with
You can add geometryGroup to any view. It changes what you see on 20 of the 39 components.
No visible effect
These components accept it, but you see no change.
| Component | Why nothing happens |
|---|---|
| Spacer | It works on the child views that you give the component, and Spacer takes none. |
| Divider | It works on the child views that you give the component, and Divider takes none. |
| Button | It works on the child views that you give the component, and Button takes none. |
| Toggle | It works on the child views that you give the component, and Toggle takes none. |
| Checkbox | It works on the child views that you give the component, and Checkbox takes none. |
| Slider | It works on the child views that you give the component, and Slider takes none. |
| Picker | It works on the child views that you give the component, and Picker takes none. |
| DatePicker | It works on the child views that you give the component, and DatePicker takes none. |
| ColorPicker | It works on the child views that you give the component, and ColorPicker takes none. |
| Link | It works on the child views that you give the component, and Link takes none. |
| Menu | It works on the child views that you give the component, and Menu takes none. |
| TextField | It works on the child views that you give the component, and TextField takes none. |
| SecureField | It works on the child views that you give the component, and SecureField takes none. |
| Text | It works on the child views that you give the component, and Text takes none. |
| Label | It works on the child views that you give the component, and Label takes none. |
| Image | It works on the child views that you give the component, and Image takes none. |
| ProgressView | It works on the child views that you give the component, and ProgressView takes none. |
| Gauge | It works on the child views that you give the component, and Gauge takes none. |
| AccessoryWidgetBackground | It works on the child views that you give the component, and AccessoryWidgetBackground takes none. |
Sources
The original Expo docs for this page:
- geometryGroup (Modifiers) (
source-of-truth/versions/v57.0.0/sdk/ui/swift-ui/modifiers.md)