core plot zoom - pinchgesture - core-plot

I have a problem with pinch gesture for zoom, the main problem is that when I zoom I zoom the center of view, so if I pinch on the top right or bottom the zoom is alway on the center of view.
This is my code, how can I edit it for make zoom on the middle of pinch touch?
- (void)handlePinchGesture:(UIPinchGestureRecognizer *)gestureRecognizer{
if (gestureRecognizer.state == UIGestureRecognizerStateBegan) {
scala = [gestureRecognizer scale];
nextScala = [gestureRecognizer scale];
//NSLog(#"Scala: %f Gesture Scala %f",scala,[gestureRecognizer scale]);
}
else if (gestureRecognizer.state == UIGestureRecognizerStateChanged) {
//CGPoint pointUno = [gestureRecognizer locationOfTouch:0 inView:[gestureRecognizer view]];
//CGPoint pointDue = [gestureRecognizer locationOfTouch:1 inView:[gestureRecognizer view]];
CGPoint point = [gestureRecognizer locationInView:[gestureRecognizer view]];
CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)graph.defaultPlotSpace;
double minX = plotSpace.xRange.minLimitDouble;
double maxX = plotSpace.xRange.maxLimitDouble;
double minY = plotSpace.yRange.minLimitDouble;
double maxY = plotSpace.yRange.maxLimitDouble;
//NSLog(#"Scala: %f Gesture Scala %f Velocity: %f",scala,[gestureRecognizer scale],[gestureRecognizer velocity]);
double lenghtX = maxX - minX;
double lenghtY = maxY - minY;
float stepScale = lenghtX/25;
if ([gestureRecognizer scale] < nextScala) {
minX = plotSpace.xRange.minLimitDouble - stepScale;
maxX = plotSpace.xRange.maxLimitDouble + stepScale;
minY = plotSpace.yRange.minLimitDouble - stepScale;
maxY = plotSpace.yRange.maxLimitDouble + stepScale;
}
else {
minX = plotSpace.xRange.minLimitDouble + stepScale;
maxX = plotSpace.xRange.maxLimitDouble - stepScale;
minY = plotSpace.yRange.minLimitDouble + stepScale;
maxY = plotSpace.yRange.maxLimitDouble - stepScale;
}
lenghtX = maxX - minX;
lenghtY = maxY - minY;
NSLog(#"Old X: %f Y: %f",point.x,point.y);
NSLog(#"New X: %f Y: %f",lenghtX-point.x,lenghtY-point.y);
if (lenghtX > 0.05 && lenghtX < 4500) {
plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(minX) length:CPTDecimalFromFloat(lenghtX)];
plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(minY) length:CPTDecimalFromFloat(lenghtY)];
nextScala = [gestureRecognizer scale];
}
}
else if (gestureRecognizer.state == UIGestureRecognizerStateEnded) {
[self performSelectorInBackground:#selector(getValues) withObject:nil];
// [self getValues];
}
}

Use this plot space method to do the scaling:
-(void)scaleBy:(CGFloat)interactionScale aboutPoint:(CGPoint)interactionPoint;

Related

How to pinch google map when it set in UIScrollView in iOS Objective C

I set Google Map in view in UIScrollView. everything OK but i can not pinch my map. How to fix it?
Salaam Reza jaan.
In your case you can use something like this. Cheers.
Edit: this is a better way to do it. Behbakht shid, direh inja :P
- (void) scaleSelfWith:(UIPinchGestureRecognizer *)gestureRecognizer{
if ([gestureRecognizer numberOfTouches] >1) {
//getting width and height between gestureCenter and one of my finger
float x = [gestureRecognizer locationInView:self].x - [gestureRecognizer locationOfTouch:1 inView:self].x;
if (x<0) {
x *= -1;
}
float y = [gestureRecognizer locationInView:self].y - [gestureRecognizer locationOfTouch:1 inView:self].y;
if (y<0) {
y *= -1;
}
//set Border
if (gestureRecognizer.state == UIGestureRecognizerStateBegan) {
xDis = self.bounds.size.width - x*2;
yDis = self.bounds.size.height - y*2;
}
//double size cause x and y is just the way from the middle to my finger
float width = x*2+xDis;
if (width < 1) {
width = 1;
}
float height = y*2+yDis;
if (height < 1) {
height = 1;
}
self.bounds = CGRectMake(self.bounds.origin.x , self.bounds.origin.y , width, height);
[gestureRecognizer setScale:1];
[[self layer] setBorderWidth:2.f];
}
}

how to stop moving image when image is not zoomed in?

I have a UIImageView i am performing pinch zoom & move image on full zoom.I am able to move the image but the issue is even if the image is not zoomed in it still moves on the screen.Please tell me how can i prevent it?
Here is the code for that
#define MINIMUM_SCALE 0.5
#define MAXIMUM_SCALE 6.0
#property CGPoint translation;
- (void)pan:(UIPanGestureRecognizer *)gesture {
static CGPoint currentTranslation;
static CGFloat currentScale = 0;
if (gesture.state == UIGestureRecognizerStateBegan) {
currentTranslation = _translation;
currentScale = self.view.frame.size.width / self.view.bounds.size.width;
}
if (gesture.state == UIGestureRecognizerStateEnded || gesture.state == UIGestureRecognizerStateChanged) {
CGPoint translation = [gesture translationInView:self.view];
_translation.x = translation.x + currentTranslation.x;
_translation.y = translation.y + currentTranslation.y;
CGAffineTransform transform1 = CGAffineTransformMakeTranslation(_translation.x , _translation.y);
CGAffineTransform transform2 = CGAffineTransformMakeScale(currentScale, currentScale);
CGAffineTransform transform = CGAffineTransformConcat(transform1, transform2);
self.view.transform = transform;
}
}
- (void)pinch:(UIPinchGestureRecognizer *)gesture {
if (gesture.state == UIGestureRecognizerStateEnded || gesture.state == UIGestureRecognizerStateChanged) {
// NSLog(#"gesture.scale = %f", gesture.scale);
CGFloat currentScale = self.view.frame.size.width / self.view.bounds.size.width;
CGFloat newScale = currentScale * gesture.scale;
if (newScale < MINIMUM_SCALE) {
newScale = MINIMUM_SCALE;
}
if (newScale > MAXIMUM_SCALE) {
newScale = MAXIMUM_SCALE;
}
CGAffineTransform transform1 = CGAffineTransformMakeTranslation(_translation.x, _translation.y);
CGAffineTransform transform2 = CGAffineTransformMakeScale(newScale, newScale);
CGAffineTransform transform = CGAffineTransformConcat(transform1, transform2);
self.view.transform = transform;
gesture.scale = 1;
}
}
**PS:**ImageView should only move when image is zoomed otherwise it should not be moveable.
I suggest a different approach:
Create a UIScrollView add the UIImageView into the scrollView's contentView and allow scrolling and zooming on the scrollView.
To prevent scrolling when not zoomed, set setScrollEnabled to NO and enable it in scrollViewDidZoom if the zoomLevel reaches a custom threshold.
So sth. like this should make make it much easier what you're trying to accomplish with a lot less code.
- (void)viewDidLoad:(BOOL)animated {
[super viewDidLoad:animated];
self.scrollView.scrollEnabled = NO;
self.scrollView.minimumZoomScale = 1;
}
- (void)scrollViewDidZoom:(UIScrollView *)scrollView {
if (scrollView.zoomLevel > 1) {
scrollView.scrollEnabled = YES;
} else {
scrollView.scrollEnabled = NO;
}
}
I re-post the code I gave you in your first question on the subject ( Pinch zoom shifting image to most left corner on iPad in iOS? ), because I think the way you do it does not work as expected ( as far as I have tested ).
The pinch zoom is supposed to zoom on the middle of the fingers, and not on the middle of the image. If you really want to apply the zoom on center, I have added a boolean property zoomOnCenter.
The boundaries checking is done in the translateBy method.
Here is a link on the xCode test project: https://drive.google.com/file/d/0B88aMtNA0z2aWVBIbGZGdVhpdWM/view?usp=sharing
Interface
#interface PinchViewController : UIViewController
#property(nonatomic,strong) IBOutlet UIView* contentView;
#property(nonatomic,assign) BOOL zoomOnCenter;
#end
Implementation
#implementation PinchViewController
{
CGPoint translation;
CGFloat scale;
CGAffineTransform scaleTransform;
CGAffineTransform translateTransform;
CGPoint previousTranslation;
CGFloat previousScale;
NSUInteger previousNumTouches;
}
-(void)viewDidLoad
{
scale = 1.0f;
scaleTransform = CGAffineTransformIdentity;
translateTransform = CGAffineTransformIdentity;
previousTranslation = CGPointZero;
previousNumTouches = 0;
UIPinchGestureRecognizer *pinch=[[UIPinchGestureRecognizer alloc]initWithTarget:self action:#selector(handlePinch:)];
[self.view addGestureRecognizer:pinch];
UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:#selector(handlePan:)];
[panGesture setMinimumNumberOfTouches:1];
[panGesture setMaximumNumberOfTouches:1];
[self.view addGestureRecognizer:panGesture];
}
-(void)handlePinch:(UIPinchGestureRecognizer*)recognizer
{
// 1 - find pinch center
CGPoint mid = self.zoomOnCenter ? CGPointZero : [self computePinchCenter:recognizer];
mid.x-= recognizer.view.bounds.size.width / 2.0f;
mid.y-= recognizer.view.bounds.size.height / 2.0f;
// 2 - compute deltas
NSUInteger numTouches = recognizer.numberOfTouches;
if ( (recognizer.state==UIGestureRecognizerStateBegan) || ( previousNumTouches != numTouches ) ) {
previousScale = recognizer.scale;
previousTranslation = mid;
previousNumTouches = numTouches;
}
CGFloat deltaScale = ( recognizer.scale - previousScale ) * scale;
previousScale = recognizer.scale;
CGPoint deltaTranslation = CGPointMake(mid.x-previousTranslation.x, mid.y-previousTranslation.y);
previousTranslation = mid;
deltaTranslation.x/=scale;
deltaTranslation.y/=scale;
// 3 - apply
scale+=deltaScale;
if (scale<0.01) scale = 0.01; else if (scale>10) scale = 10;
scaleTransform = CGAffineTransformMakeScale(scale, scale);
[self translateBy:deltaTranslation];
}
- (void)handlePan:(UIPanGestureRecognizer *)recognizer
{
if (recognizer.state==UIGestureRecognizerStateBegan) previousTranslation = CGPointZero;
CGPoint recognizerTranslation = [recognizer translationInView:self.contentView];
CGPoint deltaTranslation = CGPointMake(recognizerTranslation.x - previousTranslation.x,recognizerTranslation.y - previousTranslation.y);
previousTranslation = recognizerTranslation;
[self translateBy:deltaTranslation];
}
-(void)translateBy:(CGPoint)delta
{
CGSize contentSize = self.contentView.bounds.size;
CGSize viewSize = self.view.bounds.size;
CGSize scaledViewSize = viewSize;
scaledViewSize.width/=scale;
scaledViewSize.height/=scale;
CGPoint maxTranslation = CGPointMake( (contentSize.width-scaledViewSize.width) / 2.0f , (contentSize.height-scaledViewSize.height) / 2.0f );
if ( contentSize.width*scale < viewSize.width ) {
delta.x=0;
translation.x = 0;
} else {
translation.x+=delta.x;
if ( translation.x < - maxTranslation.x ) {
translation.x = - maxTranslation.x;
}
else if ( translation.x > maxTranslation.x ) {
translation.x = maxTranslation.x;
}
}
if ( contentSize.height*scale < viewSize.height ) {
delta.y=0; translation.y = 0;
} else {
translation.y+=delta.y;
if ( translation.y < - maxTranslation.y ) {
translation.y = - maxTranslation.y;
}
else if ( translation.y > maxTranslation.y ) {
translation.y = maxTranslation.y;
}
}
translateTransform = CGAffineTransformMakeTranslation(translation.x,translation.y);
self.contentView.transform = CGAffineTransformConcat(translateTransform,scaleTransform);
}
-(CGPoint)computePinchCenter:(UIPinchGestureRecognizer*)recognizer
{
// 1 - handle up to 3 touches
NSUInteger numTouches = recognizer.numberOfTouches;
if (numTouches>3) numTouches = 3;
// 2 - Find fingers middle point - with (0,0) being the center of the view
CGPoint pt1,pt2,pt3,mid;
switch (numTouches) {
case 3:
pt3 = [recognizer locationOfTouch:2 inView:recognizer.view];
case 2:
pt2 = [recognizer locationOfTouch:1 inView:recognizer.view];
case 1:
pt1 = [recognizer locationOfTouch:0 inView:recognizer.view];
}
switch (numTouches) {
case 3:
mid = CGPointMake( ( ( pt1.x + pt2.x ) / 2.0f + pt3.x ) / 2.0f, ( ( pt1.y + pt2.y ) / 2.0f + pt3.y ) / 2.0f );
break;
case 2:
mid = CGPointMake( ( pt1.x + pt2.x ) / 2.0f, ( pt1.y + pt2.y ) / 2.0f );
break;
case 1:
mid = CGPointMake( pt1.x, pt1.y);
break;
}
return mid;
}
#end
You can check the frame of your imageView and if it is same it means imageview has not been zoomed So you can disable the pan gesture if frame of imageview is same ......and if frame has changed then you can enable the pan gesture.....

Pinching/Panning a CCNode in Cocos2d 3.0

I want to zoom in out a CCNode by pinching and panning the screen. The node has a background which is very large but the portionof it shown on the screen. That node also contains other sprites.
What I have done by now is that first I register UIPinchGestureRecognizer
UIPinchGestureRecognizer * pinchRecognizer = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:#selector(handlePinchFrom:)];
[[[CCDirector sharedDirector] view] addGestureRecognizer: pinchRecognizer];
-(void)handlePinchFrom:(UIPinchGestureRecognizer *) pinch
{
if(pinch.state == UIGestureRecognizerStateEnded) {
prevScale = 1;
}
else {
CGFloat dscale = [self scale] - prevScale + pinch.scale;
if(dscale > 0)
{
deltaScale = dscale;
}
CGAffineTransform transform = CGAffineTransformScale(pinch.view.transform, deltaScale, deltaScale);
[pinch.view setTransform: transform];
// [_contentNode setScale:deltaScale];
prevScale = pinch.scale;
}
}
The problem is that it scalw whole UIView not the CCNode. I have also tried to by setting the scale of my _contentNode.
**EDIT
I ave also tried this
- (void)handlePinchGesture:(UIPinchGestureRecognizer*)aPinchGestureRecognizer
{
if (pinch.state == UIGestureRecognizerStateBegan || pinch.state == UIGestureRecognizerStateChanged) {
CGPoint midpoint = [pinch locationInView:[CCDirector sharedDirector].view];
CGSize winSize = [CCDirector sharedDirector].viewSize;
float x = midpoint.x/winSize.width;
float y = midpoint.y/winSize.height;
_contentNode.anchorPoint = CGPointMake(x, y);
float scale = [pinch scale];
_contentNode.scale *= scale;
pinch.scale = 1;
}
}
But it zoom from the bottom left of the screen.
I had the same problem. I use CCScrollView, that contains CCNode that larger than device screen. I want scroll and zoom it, but node shouldnt scroll out of screen, and scale smaller than screen. So, i create my subclass of CCScrollView, where i handle pinch. It has some strange glitches, but it works fine at all.
When pinch began i set anchor point of my node to pinch center on node space. Then i need change position of my node proportional to shift of anchor point, so moving anchor point doesn't change nodes location on view:
- (void)handlePinch:(UIPinchGestureRecognizer*)recognizer
{
if (recognizer.state == UIGestureRecognizerStateEnded) {
_previousScale = self.contentNode.scale;
}
else if (recognizer.state == UIGestureRecognizerStateBegan) {
float X = [recognizer locationInNode:self.contentNode].x / self.contentNode.contentSize.width;
float Y = [recognizer locationInNode:self.contentNode].y / self.contentNode.contentSize.height;
float positionX = self.contentNode.position.x + self.contentNode.boundingBox.size.width * (X - self.contentNode.anchorPoint.x);
float positionY = self.contentNode.position.y + self.contentNode.boundingBox.size.height * (Y - self.contentNode.anchorPoint.y);
self.contentNode.anchorPoint = ccp(X, Y);
self.contentNode.position = ccp(positionX, positionY);
}
else {
CGFloat scale = _previousScale * recognizer.scale;
if (scale >= maxScale) {
self.contentNode.scale = maxScale;
}
else if (scale <= [self minScale]) {
self.contentNode.scale = [self minScale];
}
else {
self.contentNode.scale = scale;
}
}
}
Also i need change CCScrollView min and max scroll, so my node never scroll out of view. Default anchor point is (0,1), so i need shift min and max scroll proportional to the new anchor point.
- (float) maxScrollX
{
if (!self.contentNode) return 0;
float maxScroll = self.contentNode.boundingBox.size.width - self.contentSizeInPoints.width;
if (maxScroll < 0) maxScroll = 0;
return maxScroll - self.contentNode.boundingBox.size.width * self.contentNode.anchorPoint.x;
}
- (float) maxScrollY
{
if (!self.contentNode) return 0;
float maxScroll = self.contentNode.boundingBox.size.height - self.contentSizeInPoints.height;
if (maxScroll < 0) maxScroll = 0;
return maxScroll - self.contentNode.boundingBox.size.height * (1 - self.contentNode.anchorPoint.y);
}
- (float) minScrollX
{
float minScroll = [super minScrollX];
return minScroll - self.contentNode.boundingBox.size.width * self.contentNode.anchorPoint.x;
}
- (float) minScrollY
{
float minScroll = [super minScrollY];
return minScroll - self.contentNode.boundingBox.size.height * (1 - self.contentNode.anchorPoint.y);
}
UIGestureRecognizerStateEnded doesn't have locationInNode: method, so i added it by category. It just return touch location on node space:
#import "UIGestureRecognizer+locationInNode.h"
#implementation UIGestureRecognizer (locationInNode)
- (CGPoint) locationInNode:(CCNode*) node
{
CCDirector* dir = [CCDirector sharedDirector];
CGPoint touchLocation = [self locationInView: [self view]];
touchLocation = [dir convertToGL: touchLocation];
return [node convertToNodeSpace:touchLocation];
}
- (CGPoint) locationInWorld
{
CCDirector* dir = [CCDirector sharedDirector];
CGPoint touchLocation = [self locationInView: [self view]];
return [dir convertToGL: touchLocation];
}
#end

Scale Font size with UITextview resizing

i want to create UITextView which is scaled and rotate with one finger touch(Pan gesture).But problem is the text Font size is not scaled properly. Please help.
it works,but not perfectly.
-(void)resizeTranslate:(UIPanGestureRecognizer *)recognizer
{
if ([recognizer state]== UIGestureRecognizerStateBegan)
{
prevPoint = [recognizer locationInView:vw_txtfield.superview];
[vw_txtfield setNeedsDisplay];
olddistance = sqrt(pow((vw_txtfield.frame.origin.x - prevPoint.x), 2.0) + pow((vw_txtfield.frame.origin.y - prevPoint.y), 2.0));
}
else if ([recognizer state] == UIGestureRecognizerStateChanged)
{
CGPoint point = [recognizer locationInView:vw_txtfield.superview];
newdistance = sqrt(pow((vw_txtfield.frame.origin.x - point.x), 2.0) + pow((vw_txtfield.frame.origin.y - point.y), 2.0));
float wChange = 0.0, hChange = 0.0;
wChange = newdistance / olddistance ;//Slow down increment
NSLog(#"wchange %f",wChange);
hChange= newdistance / olddistance;
NSLog(#"hchange %f",hChange);
if (txt_LableText.font.pointSize<=6 && wChange<1) {
return;
}
else
{
vw_txtfield.bounds = CGRectMake(vw_txtfield.bounds.origin.x, vw_txtfield.bounds.origin.y, vw_txtfield.bounds.size.width * (wChange), vw_txtfield.bounds.size.height * (hChange));
[txt_LableText setContentScaleFactor: newdistance / olddistance ];
float int_NewFontsize= ( newdistance / olddistance) * txt_LableText.font.pointSize;
NSLog(#"font size %f",int_NewFontsize);
[txt_LableText setFont:[UIFont fontWithName:txt_LableText.font.fontName size:int_NewFontsize]];
prevPoint = [recognizer locationInView:vw_txtfield.superview];
[vw_txtfield setNeedsDisplay];
olddistance = sqrt(pow((vw_txtfield.frame.origin.x - point.x), 2.0) + pow((vw_txtfield.frame.origin.y - point.y), 2.0));
}
}
else if ([recognizer state] == UIGestureRecognizerStateEnded)
{
prevPoint = [recognizer locationInView:vw_txtfield.superview];
[vw_txtfield setNeedsDisplay];
}
}

iOS UIPinchGestureRecognizer getting offset with unknown source at the UIGestureRecognizerStateEnded state

I have a UIView with custom drawRect() method, used for some drawing.
I use UIPinchGestureRecognizer to achieve zooming effect.
This is action method:
- (IBAction)handlePinch:(UIPinchGestureRecognizer *)recognizer
{
//NSLog(#"Pinch gesture recognized");
CGPoint touchOrigin = [recognizer locationInView:self];
_currentScaleOrigin = touchOrigin;
if (recognizer.state == UIGestureRecognizerStateEnded)
{
NSLog(#"%16# x = %f, y = %f", #"Pinch end:", touchOrigin.x, touchOrigin.y);
return;
}
if (recognizer.state == UIGestureRecognizerStateChanged)
{
//NSLog(#"scale = %f", recognizer.scale);
NSLog(#"%16# x = %f, y = %f", #"Pinch origin:", touchOrigin.x, touchOrigin.y);
// scale has at start a value of 1.0 and increases as fingers moves away from each other
_currentScaleLevel += recognizer.scale - 1;
[self setNeedsDisplay]; // call drawRect for redrawing at current scale level
}
recognizer.scale = 1;
}
When receiving UIGestureRecognizerStateEnded message i get some strange offset to coordinates:
Pinch origin: x = 358.000000, y = 630.000000
Pinch origin: x = 355.000000, y = 627.000000
Pinch origin: x = 353.000000, y = 625.000000
Pinch origin: x = 351.000000, y = 624.000000
Pinch origin: x = 351.000000, y = 623.000000
Pinch origin: x = 350.000000, y = 622.000000
Pinch origin: x = 349.000000, y = 622.000000
Pinch origin: x = 349.000000, y = 622.000000
Pinch end: x = 315.000000, y = 750.000000
... and translation for free :) which i dont need.
I dont know from where translation comes from.
How to disable this translation?
Solved it.
When receiving UIGestureRecognizerStateEnded i was assigning a point of last of two fingers to my _currentScaleOrigin which is for performing scaling transformation.
I didnt know that UIPinchGestureRecognizer returns a CGPoint of last finger position on screen.
Here is whole method code:
- (IBAction)handlePinch:(UIPinchGestureRecognizer *)recognizer
{
#if 1
static CGPoint point_0;
static CGPoint point_1;
if ([recognizer numberOfTouches] > 1)
{
point_0 = [recognizer locationOfTouch:0 inView:self];
point_1 = [recognizer locationOfTouch:1 inView:self];
NSLog(#"pinch loc 0: (%f, %f)", point_0.x , point_0.y);
NSLog(#"pinch loc 1: (%f, %f)", point_1.x , point_1.y);
} else if ([recognizer numberOfTouches] == 1) {
point_0 = [recognizer locationOfTouch:0 inView:self];
NSLog(#"pinch loc 0: (%f, %f)", point_0.x , point_0.y);
}
#endif
switch (recognizer.state)
{
case UIGestureRecognizerStateBegan:
{
CGPoint pointBegin = [recognizer locationInView:self];
NSLog(#"%16# x = %f, y = %f", #"Pinch start:", pointBegin.x, pointBegin.y);
} break;
case UIGestureRecognizerStateChanged:
{
_currentScaleOrigin = [recognizer locationInView:self];
//NSLog(#"scale = %f", recognizer.scale);
NSLog(#"%16# x = %f, y = %f", #"Pinch origin:", _currentScaleOrigin.x, _currentScaleOrigin.y);
// scale has at start a value of 1.0 and increases as fingers moves away from each other
_currentScaleLevel += recognizer.scale - 1;
// call drawRect for redrawing at current scale level
[self setNeedsDisplay];
} break;
case UIGestureRecognizerStateEnded:
{
CGPoint pointEnded = [recognizer locationInView:self];
NSLog(#"%16# x = %f, y = %f", #"Pinch end:", pointEnded.x, pointEnded.y);
//return;
} break;
default :
{
NSLog(#"other state");
}
}
recognizer.scale = 1;
}

Resources