From d821ecc1bb06d52d40cd947387eb296aaa82371a Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Mon, 21 Mar 2011 18:43:43 -0700 Subject: Provide -[CyteWebView scrollView] helper. --- CyteKit/WebView.h | 1 + CyteKit/WebView.mm | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/CyteKit/WebView.h b/CyteKit/WebView.h index ba2043b..c7eeb4b 100644 --- a/CyteKit/WebView.h +++ b/CyteKit/WebView.h @@ -83,6 +83,7 @@ enum CYWebPolicyDecision { - (id) delegate; - (void) dispatchEvent:(NSString *)event; - (void) reloadFromOrigin; +- (UIScrollView *) scrollView; @end diff --git a/CyteKit/WebView.mm b/CyteKit/WebView.mm index 7fac96e..a71e5c2 100644 --- a/CyteKit/WebView.mm +++ b/CyteKit/WebView.mm @@ -361,6 +361,14 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se [[[self _documentView] webView] reloadFromOrigin:nil]; } +- (UIScrollView *) scrollView { + if ([self respondsToSelector:@selector(_scrollView)]) + return [self _scrollView]; + else if ([self respondsToSelector:@selector(_scroller)]) + return (UIScrollView *) [self _scroller]; + else return nil; +} + @end static void $UIWebViewWebViewDelegate$_clearUIWebView(UIWebViewWebViewDelegate *self, SEL sel) { -- cgit v1.2.3