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

# location(ofTouch:in:)

Returns the location of one of the gesture’s touches in the local coordinate system of a given view.

```
func location(ofTouch touchIndex: Int, in view: UIView?) -> CGPoint
```

## Parameters

`touchIndex`

The index of a [`UITouch`](/documentation/UIKit/UITouch) object in a private array maintained by the receiver. This touch object represents a touch of the current gesture.

`view`

A [`UIView`](/documentation/UIKit/UIView) object on which the gesture took place. Specify `nil` to indicate the window.

## Return Value

A point in the local coordinate system of `view` that identifies the location of the touch. If `nil` is specified for `view`, the method returns the touch location in the window’s base coordinate system.

## Discussion

---

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)