---
title: "location(ofTouch:in:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uigesturerecognizer/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.

## Declaration

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

## Parameters

- `touchIndex`: The index of a doc://com.apple.uikit/documentation/UIKit/UITouch object in a private array maintained by the receiver. This touch object represents a touch of the current gesture.
- `view`: A doc://com.apple.uikit/documentation/UIKit/UIView object on which the gesture took place. Specify nil to indicate the window.

## Return Value

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.

## See Also

### Getting the touches and location of a gesture

- [location(in:)](uikit/uigesturerecognizer/location(in:).md)
- [numberOfTouches](uikit/uigesturerecognizer/numberoftouches.md)
