<!--
{
  "availability" : [
    "macOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/NSGestureRecognizerRepresentableCoordinateSpaceConverter/convert(globalPoint:to:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI56NSGestureRecognizerRepresentableCoordinateSpaceConverterV7convert11globalPoint2toSo7CGPointVAH_xtAA0fG8ProtocolRzlF"
  },
  "title" : "convert(globalPoint:to:)"
}
-->

# convert(globalPoint:to:)

Converts a point in the global coordinate space to a SwiftUI coordinate
space of an ancestor of the view the gesture recognizer is attached to.

```
func convert(globalPoint: CGPoint, to coordinateSpace: some CoordinateSpaceProtocol = .local) -> CGPoint
```

## Parameters

`globalPoint`

The point in the global coordinate space.

`coordinateSpace`

The SwiftUI coordinate space to convert to.

## Return Value

A point converted to the given `coordinateSpace`.

---

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)