开发者

iPhone multi-touch coordinates

开发者 https://www.devze.com 2023-03-10 15:47 出处:网络
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 youchec

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消