Instance Method

location(in:)

Returns the location of the touch that started the interaction.

Declaration

func location(in coordinateSpace: UICoordinateSpace?) -> CGPoint

Parameters

coordinateSpace

The coordinate space in which the touch location should be returned

Return Value

The CGPoint that represents the current location of the touch, translated into the requested coordinate space.

Discussion

Use this method to establish the current location of the touch that triggered the preview interaction.

When the preview interaction is not running, calling this method returns an invalid point. You must therefore only call this method in response to one of the delegate callbacks specified in UIPreviewInteractionDelegate.

See Also

Handling Preview Interactions

var view: UIView?

The view from which the preview interaction receives touch events.

func cancel()

Cancels the current preview interaction.