Created
July 19, 2009 23:41
-
-
Save stevestreza/150082 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// SSScrollView.h | |
// | |
/* | |
Get a delegate callback when the scroll view scrolls. | |
*/ | |
#import <Cocoa/Cocoa.h> | |
@class SSScrollView; | |
@protocol SSScrollViewDelegate | |
-(void)scrollViewDidScroll:(SSScrollView *)scrollView; | |
@end | |
@interface SSScrollView : NSScrollView { | |
IBOutlet id<SSScrollViewDelegate> delegate; | |
} | |
@property (nonatomic,assign) id<SSScrollViewDelegate> delegate; | |
@end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// SSScrollView.m | |
// | |
#import "SSScrollView.h" | |
@implementation SSScrollView | |
@synthesize delegate; | |
- (void)reflectScrolledClipView:(NSClipView *)aClipView{ | |
[super reflectScrolledClipView:aClipView]; | |
if(delegate && [delegate respondsToSelector:@selector(scrollViewDidScroll:)]){ | |
[delegate scrollViewDidScroll:self]; | |
} | |
} | |
@end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment