Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[UIWebView setScrollsToTop:(BOOL)]

  • Loading branch information...
commit 497ff1f8e0ae25e83a44f6202e41c9d52a88fd8b 1 parent dbb083e
@mxcl authored
View
1  MBCategories.h
@@ -10,3 +10,4 @@
#import "UIApplication+mxcl.h"
#import "UITableView+mxcl.h"
#import "UIView+mxcl.h"
+#import "UIWebView+mxcl.h"
View
1  MBCategories.m
@@ -10,3 +10,4 @@
#import "UIApplication+mxcl.m"
#import "UITableView+mxcl.m"
#import "UIView+mxcl.m"
+#import "UIWebView+mxcl.m"
View
5 UIWebView+mxcl.h
@@ -0,0 +1,5 @@
+#import <UIKit/UIKit.h>
+
+@interface UIWebView (mxcl)
+- (void)setScrollsToTop:(BOOL)scrollsToTop;
+@end
View
11 UIWebView+mxcl.m
@@ -0,0 +1,11 @@
+#import "UIWebView+mxcl.h"
+
+@implementation UIWebView (mxcl)
+- (void)setScrollsToTop:(BOOL)scrollsToTop {
+ for (UIScrollView *sv in self.subviews)
+ if ([sv isKindOfClass:[UIScrollView class]] && [sv respondsToSelector:@selector(setScrollsToTop:)]) {
+ sv.scrollsToTop = scrollsToTop;
+ scrollsToTop = NO; // you can only set one scrollsToTop to YES or none will do it
+ }
+}
+@end
Please sign in to comment.
Something went wrong with that request. Please try again.