From 4a640290cc65e4f77d5bf556bf42723d7a840b3a Mon Sep 17 00:00:00 2001 From: SuiFeng Date: Sat, 17 Dec 2011 15:43:35 +0800 Subject: [PATCH] 1.0 --- GAScrollView.h | 28 ++++++++++++++++++++++++++++ GAScrollView.m | 24 ++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 GAScrollView.h create mode 100644 GAScrollView.m diff --git a/GAScrollView.h b/GAScrollView.h new file mode 100644 index 0000000..77f8edd --- /dev/null +++ b/GAScrollView.h @@ -0,0 +1,28 @@ +// +// GAScrollView.h +// Car +// +// Created by apple on 11-12-17. +// Copyright (c) 2011年 __MyCompanyName__. All rights reserved. +// + +#import + +@protocol GAScrollViewDelegate; + +@interface GAScrollView : UIScrollView +{ + id GADelegate_; +} + +@property (nonatomic, assign) id GADelegate; + +@end + + +@protocol GAScrollViewDelegate + +@optional +- (void) GAScrollView:(GAScrollView *)scroll touchBegin:(NSSet *)touches withEvent:(UIEvent *)event; + +@end \ No newline at end of file diff --git a/GAScrollView.m b/GAScrollView.m new file mode 100644 index 0000000..d89787f --- /dev/null +++ b/GAScrollView.m @@ -0,0 +1,24 @@ +// +// GAScrollView.m +// Car +// +// Created by apple on 11-12-17. +// Copyright (c) 2011年 __MyCompanyName__. All rights reserved. +// + +#import "GAScrollView.h" + +@implementation GAScrollView + +@synthesize GADelegate = GADelegate_; + +- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event +{ + [super touchesBegan:touches withEvent:event]; + [self.superview touchesBegan:touches withEvent:event]; + if ([GADelegate_ respondsToSelector:@selector(GAScrollView:touchBegin:withEvent:)]) { + [GADelegate_ GAScrollView:self touchBegin:touches withEvent:event]; + } +} + +@end