Skip to content

Instantly share code, notes, and snippets.

@marshluca
Created July 15, 2011 06:02
Show Gist options
  • Save marshluca/1084166 to your computer and use it in GitHub Desktop.
Save marshluca/1084166 to your computer and use it in GitHub Desktop.
UIScrollViewDelegate
@protocol UIScrollViewDelegate
@optional
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
@end
@interface UIScrollView : UIView
@property (assign) id <UIScrollViewDelegate> delegate;
@end
@interface MyViewController : UIViewController <UIScrollViewDelegate>
...
@end
MyViewController *myVC = [[MyViewController alloc] init];
UIScrollView *scrollView = ...;
scrollView.delegate=myViewController; //compiler won’t complain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment