Instance Method

beginTrackingWithTouch:withEvent:

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

Declaration

- (BOOL)beginTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event;

Parameters

touch

The object containing information about the touch event.

event

The event object containing the touch event.

Return Value

YES if the control should continue tracking touch events or NO if it should stop. This value is used to update the tracking property of the control.

Discussion

The default implementation of this method always returns YES. 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 YES. If you want to stop tracking the touch event, return NO.

See Also

Tracking Touches and Redrawing Controls

- continueTrackingWithTouch:withEvent:

Called when a touch event associated with the control is updated.

- endTrackingWithTouch:withEvent:

Called when a touch event associated with the control ends.

- cancelTrackingWithEvent:

Tells the control to cancel tracking related to the given event.

tracking

A Boolean value indicating whether the control is currently tracking touch events.

touchInside

A Boolean value indicating whether a tracked touch event is currently inside the control’s bounds.