Assigns a name to the view’s coordinate space, so other code can operate on dimensions like points and sizes relative to the named space.
- iOS 13.0+
- macOS 10.15+
- Mac Catalyst 13.0+
- tvOS 13.0+
- watchOS 6.0+
- Xcode 11.0+
A name used to identify this coordinate space.
coordinate to allow another function to find and operate on a view and operate on dimensions relative to that view.
The example below demonstrates how a nested view can find and operate on its enclosing view’s coordinate space:
circle view has an attached
Drag that targets the enclosing vertical stack’s coordinate space. As the gesture recognizer’s closure registers events inside
circle it stores them in the shared
location state variable and the
VStack displays the coordinates in a