Instance Method

touchesShouldBegin:withEvent:inContentView:

Overridden by subclasses to customize the default behavior when a finger touches down in displayed content.

Declaration

- (BOOL)touchesShouldBegin:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event inContentView:(UIView *)view;

Parameters

touches

A set of UITouch instances that represent the touches for the starting phase of the event represented by event.

event

An object representing the event to which the touch objects in touches belong.

view

The subview in the content where the touch-down gesture occurred.

Return Value

Return NO if you don’t want the scroll view to send event messages to view. If you want view to receive those messages, return YES (the default).

Discussion

The default behavior of UIScrollView is to invoke the UIResponder event-handling methods of the target subview that the touches occur in.

See Also

Managing Touches

touchesShouldCancelInContentView:

Returns whether to cancel touches related to the content subview and start dragging.

canCancelContentTouches

A Boolean value that controls whether touches in the content view always lead to tracking.

delaysContentTouches

A Boolean value that determines whether the scroll view delays the handling of touch-down gestures.

directionalPressGestureRecognizer

The underlying gesture recognizer for directional button presses.