summaryrefslogtreecommitdiff
path: root/CyteKit
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-03-13 14:29:45 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2011-03-14 05:09:09 -0700
commit4f651400990874d88ab8be0403e371f88e36b954 (patch)
tree06d25d96a04b6e330b1811d97400127bc27e0688 /CyteKit
parent31f9c8f728e31d0614b9c0aa9fe3ddb60545a366 (diff)
Add dispatchEvent:@"CydiaTouchEnd".
Diffstat (limited to 'CyteKit')
-rw-r--r--CyteKit/dispatchEvent.mm17
1 files changed, 17 insertions, 0 deletions
diff --git a/CyteKit/dispatchEvent.mm b/CyteKit/dispatchEvent.mm
index 277d89b..f0e79ad 100644
--- a/CyteKit/dispatchEvent.mm
+++ b/CyteKit/dispatchEvent.mm
@@ -74,3 +74,20 @@
}
@end
+
+MSHook(void, UIWebBrowserView$_webTouchEventsRecognized$, UIWebBrowserView *self, SEL _cmd, UIWebTouchEventsGestureRecognizer *recognizer) {
+ _UIWebBrowserView$_webTouchEventsRecognized$(self, _cmd, recognizer);
+
+ if ([recognizer type] == 8)
+ //if ([[recognizer _typeDescription] isEqualToString:@"WebEventTouchEnd"])
+ [self dispatchEvent:@"CydiaTouchEnd"];
+}
+
+__attribute__((__constructor__)) static void $() {
+ if (Class $UIWebBrowserView = objc_getClass("UIWebBrowserView")) {
+ if (Method method = class_getInstanceMethod($UIWebBrowserView, @selector(_webTouchEventsRecognized:))) {
+ _UIWebBrowserView$_webTouchEventsRecognized$ = reinterpret_cast<void (*)(UIWebBrowserView *, SEL, id)>(method_getImplementation(method));
+ method_setImplementation(method, reinterpret_cast<IMP>(&$UIWebBrowserView$_webTouchEventsRecognized$));
+ }
+ }
+}