¡@

Home 

2014/10/15 ¤U¤È 10:16:06

iphone Programming Glossary: yourviewhere

Using UIPinchGestureRecognizer to scale uiviews in single direction

http://stackoverflow.com/questions/6759028/using-uipinchgesturerecognizer-to-scale-uiviews-in-single-direction

like this if gestureRecognizer state UIGestureRecognizerStateBegan lastTouchPosition gestureRecognize locationInView yourViewHere hScale 1 vScale 1 else if gestureRecognizer state UIGestureRecognizerStateBegan gestureRecognizer state UIGestureRecognizerStateChanged.. gestureRecognizer state UIGestureRecognizerStateChanged CGPoint currentTouchLocation gestureRecognize locationInView yourViewHere CGPoint deltaMove CGPointDistance currentTouchLocation lastTouchPosition float distance sqrt deltaMove.x deltaMove.x deltaMove.y.. of doing is if gestureRecognizer state UIGestureRecognizerStateBegan lastTouchPosition gestureRecognize locationInView yourViewHere else if gestureRecognizer state UIGestureRecognizerStateBegan gestureRecognizer state UIGestureRecognizerStateChanged CGPoint..