diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2011-03-21 18:43:43 -0700 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2011-03-21 18:43:43 -0700 |
commit | d821ecc1bb06d52d40cd947387eb296aaa82371a (patch) | |
tree | 112de4f50d8f28409bedd1e8cc647b1d90566a5a /CyteKit | |
parent | a68d4636c816f3f70192f55d78fc0ec00b72dd5a (diff) |
Provide -[CyteWebView scrollView] helper.
Diffstat (limited to 'CyteKit')
-rw-r--r-- | CyteKit/WebView.h | 1 | ||||
-rw-r--r-- | CyteKit/WebView.mm | 8 |
2 files changed, 9 insertions, 0 deletions
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<CyteWebViewDelegate>) 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) { |