---
title: "location(in:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uipreviewinteraction/location(in:)"
---

# location(in:)

Returns the location of the touch that started the interaction.

## Declaration

```swift
func location(in coordinateSpace: (any UICoordinateSpace)?) -> CGPoint
```

## Parameters

- `coordinateSpace`: The coordinate space in which the touch location should be returned.

## Return Value

Return Value The CGPoint that represents the current location of the touch, translated into the requested coordinate space.

## Discussion

Discussion Use this method to establish the current location of the touch that triggered the preview interaction. note: UIView adopts the UICoordinateSpace protocol, so you can find the touch location within a view in the view hierarchy. When the preview interaction isn’t running, calling this method returns an invalid point. You must therefore only call this method in response to one of the delegate callbacks specified in UIPreviewInteractionDelegate.

## See Also

### Handling preview interactions

- [view](uikit/uipreviewinteraction/view.md)
- [cancel()](uikit/uipreviewinteraction/cancel().md)
