iPhone multi-touch coordinates
I am making an iphone app that uses two fingers to place and scale a platform. I 开发者_JS百科need to find the x & y coordinates of BOTH of these touches. How would I go about this. thanks you
check touchesBegan, touchesMoved and touchesEnded in your UIView subclass. This is explained in the Apple docs.
You should go through Gesture Recognizers
. Gesture Recognizers are a better approach to touchesBegan:
and its siblings if you are developing for iOS 3.2
and later. For the purpose of scaling, you can look at UIPinchGestureRecognizer
. Also, remember to enable multitouch by setting the view's multipleTouchEnabled
to YES
.
精彩评论