Ok, this is what you do.
In your .h file add the delegate.
@interface ViewController2 : UIViewController <UIScrollViewDelegate> {
IBOutlet UIScrollView *scroller;
}
@property (nonatomic, retain) UIScrollView *scroller;
@end
In your implementation .m file be sure to add the synthesize statement for your scroller
#import "ViewController2.h"
@implementation ViewController2
@synthesize scroller;
Then in your viewDidLoad method override as follows:
- (void)viewDidLoad {
[scroller setScrollEnabled:YES];
[scroller setContentSize:CGSizeMake(320, 600)];
scroller.maximumZoomScale = 4.0;
scroller.minimumZoomScale = 0.75;
scroller.clipsToBounds = YES;
//here is the delegate portion below
scroller.delegate = self;
[self.view bringSubviewToFront:scroller];
[super viewDidLoad];
}
Do not forget to connect it properly in Interface builder. Link scroller to your control!