i wanted to find an "easy" way to use the pinch/zoom function on my app! so i decided to use a UIScrollView. so far so good.
i load my image from an sqlite db like so:
- (void)viewWillAppear:(BOOL)animated {
imageView.image = entity.Aattribute;
}
- (void)viewDidLoad {
self.title = @"Title";
imageView = [[UIImageView alloc] initWithFrame:[UIScreen mainScreen].applicationFrame];
imageView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
imageView.contentMode = UIViewContentModeScaleAspectFit;
imageView.backgroundColor = [UIColor blackColor];
myScrollView.contentSize = CGSizeMake(imageView.frame.size.width, imageView.frame.size.height);
myScrollView.maximumZoomScale = 4.0;
myScrollView.minimumZoomScale = 0.75;
myScrollView.clipsToBounds = YES;
myScrollView.delegate = self;
[myScrollView addSubview:imageView];
self.view = myScrollView;
}
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
return imageView;
}
any help would be appreciated!
thank you for your time!
EDIT: i m just gonna answer my own question here! (i m getting better at this!!! LOL)
up above is the working code. i have edited it so if anyone needs this can refer to it! thanks for the answers!