I just figured out how to get zooming to work for a UIImageView on top of a UIScrollView (by implementing the viewForZoomingInScrollView: delegate method). Problem is I don't want an image view, I want a custom view (because I'm drawing on that view with Quartz). When I swap out the image view for the custom view, zooming no longer works (although panning still does). Any ideas? Is zooming supported for all types of views, not just image views? My code looks like this:
Code:
- (void) loadScrollView {
self.editView = [[EditView alloc] initWithFrame: CGRectMake( 0.0, 0.0, kEditViewWidth, kEditViewHeight )];
[scrollView addSubview: editView];
[scrollView setContentSize: CGSizeMake( editView.frame.size.width, editView.frame.size.height )];
[scrollView setScrollEnabled: YES];
Code:
- (UIView *) viewForZoomingInScrollView: (UIScrollView *) scrollView {
return self.editView;