{
if ( [gestureRecognizer isKindOfClass:[UIPinchGestureRecognizer class]] ) {
beginGestureScale = effectiveScale;
}
NSLog(@"we did should begin");
return YES;
}
- (IBAction)handlePinchGesture:(UIPinchGestureRecognizer *)recognizer
{
BOOL allTouchesAreOnThePreviewLayer = YES;
NSUInteger numTouches = [recognizer numberOfTouches], i;
for ( i = 0; i < numTouches; ++i ) {
NSLog(@"%lu",(unsigned long)i);
CGPoint location = [recognizer locationOfTouch:i inView: overlayView];
CGPoint convertedLocation = [prevLayer convertPoint:location fromLayer:prevLayer.superlayer];
if ( ! [prevLayer containsPoint:convertedLocation] ) {
allTouchesAreOnThePreviewLayer = NO;
NSLog(@"we broke");
break;
}
}
if ( allTouchesAreOnThePreviewLayer ) {
effectiveScale = beginGestureScale * recognizer.scale;
if (effectiveScale < 1.0)
effectiveScale = 1.0;
CGFloat maxScaleAndCropFactor = [[output connectionWithMediaType:AVMediaTypeVideo] videoMaxScaleAndCropFactor];
if (effectiveScale > maxScaleAndCropFactor)
effectiveScale = maxScaleAndCropFactor;
[CATransaction begin];
NSLog(@"transition started");
[CATransaction setAnimationDuration:.025];
[prevLayer setAffineTransform:CGAffineTransformMakeScale(effectiveScale, effectiveScale)];
[CATransaction commit];
NSLog(@"commit");
}
}
from there I got it to recognize gestures but the whole screen turns black when touched. I get NSLogs that its recognizing and executing the code. Just isnt resizing the view.
Any help would be insanely appreciated. Ive been digging around for a while. Many people have been trying to safely do this as well and I think this will finally be the answer people are waiting for I hope.
Love your guys work and support more than you could ever know!
-Nathan
Nevermind It seems that I havent set the stillImageOutput to use the stillImageConnection....