---
title: "convert(globalPoint:to:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/nsgesturerecognizerrepresentablecoordinatespaceconverter/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.

## Declaration

```swift
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

Return Value A point converted to the given coordinateSpace.
