I got a photo gallery app an have an issue getting ready for ios 8. The images are displayed in a UIPageViewController and every page has a view with a custom UIScrollView class. It's just like Apples PhotoScroller Sample (https://developer.apple.com/library/ios/samplecode/PhotoScroller/Introduction/Intro.html)
I added a UITapGestureRecognizer for double tapping. Here's the code i use for zooming:
- (void)scrollViewDoubleTapped:(UITapGestureRecognizer*)recognizer {
if (self.minimumZoomScale == self.maximumZoomScale) return;
if (self.zoomScale == self.minimumZoomScale) didDoubleTap = NO;
CGPoint pointInView = [recognizer locationInView:_zoomView];
CGFloat newZoomScale;
if (!didDoubleTap && self.zoomScale <= self.minimumZoomScale) {
newZoomScale = self.zoomScale * 2.5f;
newZoomScale = MIN(newZoomScale, self.maximumZoomScale);
didDoubleTap = YES;
}
else {
newZoomScale = self.minimumZoomScale;
didDoubleTap = NO;
}
CGSize scrollViewSize = self.bounds.size;
CGFloat w = scrollViewSize.width / newZoomScale;
CGFloat h = scrollViewSize.height / newZoomScale;
CGFloat x = pointInView.x - (w / 2.0f);
CGFloat y = pointInView.y - (h / 2.0f);
CGRect rectToZoomTo = CGRectMake(x, y, w, h);
[self zoomToRect:rectToZoomTo animated:YES];
}
This works when i run it on xcode 5.1 perfectly, like in any other photo apps. But when i run / build it on xcode 6 gm the animation for the zoom gets wierd. First the content offset is set to the future location, and then it zooms in. So the images is jumping up or down.
anyone had this issue before or have any ideas?