<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIControl/beginTracking(_:with:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIControl(im)beginTrackingWithTouch:withEvent:"
  },
  "title" : "beginTracking(_:with:)"
}
-->

# beginTracking(_:with:)

Notifies the control when a touch event enters the control’s bounds.

```
func beginTracking(_ touch: UITouch, with event: UIEvent?) -> Bool
```

## Parameters

`touch`

The object containing information about the touch event.

`event`

The event object containing the touch event.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the control should continue tracking touch events or <doc://com.apple.documentation/documentation/Swift/false> if it should stop. This value is used to update the [`isTracking`](/documentation/UIKit/UIControl/isTracking) property of the control.

## Discussion

The default implementation of this method always returns <doc://com.apple.documentation/documentation/Swift/true>. Subclasses can override this method and use it to respond to events. Use the provided event information to detect which part of your control was hit and to set up any initial state information. If you want to continue tracking the touch event, return <doc://com.apple.documentation/documentation/Swift/true>. If you want to stop tracking the touch event, return <doc://com.apple.documentation/documentation/Swift/false>.

---

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)