EHarpham
EHarpham

Reputation: 622

Programmatically call gesture on ios

I would like to create an application that can call a gesture (swipe, pinch etc) without having to physically do the gesture.

The button would sit next to a webview to allow the gesture to be called inside it.

I have searched for a possible way to do this but cannot find and reference of calling a gesture programatically.

Does anyone have any advice of how this would be possible?

Upvotes: 0

Views: 680

Answers (2)

Daij-Djan
Daij-Djan

Reputation: 50089

[[UIApplication sharedApplicationd] sendAction:@selector(action) to:target :from:webview forEvent:touchEventOrNil];

I prefer this for actions to plain performSelector

Upvotes: 1

Blaine Murray
Blaine Murray

Reputation: 250

Try manually calling the selector associated with your gesture in code.

Upvotes: 5

Related Questions