<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIPreviewInteraction/location(in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIPreviewInteraction(im)locationInCoordinateSpace:"
  },
  "title" : "location(in:)"
}
-->

# location(in:)

Returns the location of the touch that started the interaction.

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

## Parameters

`coordinateSpace`

The coordinate space in which the touch location should be returned.

## Return Value

The <doc://com.apple.documentation/documentation/CoreFoundation/CGPoint> that represents the current location of the touch, translated into the requested coordinate space.

## Discussion

Use this method to establish the current location of the touch that triggered the preview interaction.

> Note:
> ``doc://com.apple.uikit/documentation/UIKit/UIView`` adopts the ``doc://com.apple.uikit/documentation/UIKit/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`](/documentation/UIKit/UIPreviewInteractionDelegate).

---

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)