views:

1274

answers:

2

Greetings!

I'm trying to have a UIWebView controlled from generated events.

Is there a part of the documented iphone SDK to programatically create a UIEvent (or action or something) that I can then pass to a UIWebView and have it interpret it like a user's gesture?

I'd settle just if somebody could show me or link to just creating a pinch event!

Or if anybody knows WHY this is impossible or only accomplished in someway that violates the license that would also be helpful...

Thanks guys

A: 

Although there is no documented method to create a UIEvent, you can intercept and resend UIEvents by implementing -sendEvent: in a custom UIApplication subclass.

Using private methods you can call [[UIEvent alloc] _initWithTouches:(NSMutableSet *)touches keyedTouches:NULL] to get a new UIEvent

If you are looking to specifically set the zoom level on a UIWebView the documented way would be to do so via javascript.

rpetrich
A: 

Take a look at bromine on google code. It generates touch events as part of the test process.

Roger Nolan