How to disable UIWebView from user scrolling?

#import <objc/runtime.h>

    id scroller = [[Webview subviews] lastObject];
    int count;
    Method *method = class_copyMethodList([scroller class], &count);
    int i;
    for (i=0; i<count; i++) {
        if (strcmp(method_getName(method[i]), "setScrollingEnabled:") == 0)
            break;
    }
    IMP test = method_getImplementation(method[i]);
    test(scroller, @selector(setScrollingEnabled:), NO);

Blogged with the Flock Browser
Advertisements