开发者

Cocoa iPhone SDK development - touchesBegan method not working if the UIImageView has CABasicAnimation attached

开发者 https://www.devze.com 2023-02-23 08:23 出处:网络
I\'ve created a class derived from UIImageView (class name Customer). Within this Customer class I implemented the method \"touchesBegan\" .

I've created a class derived from UIImageView (class name Customer). Within this Customer class I implemented the method "touchesBegan" .

Also, I applied a CABasicAnimation to the layer of the Customer class . (the animation simply moves the imageview. it's neccessary because i want to track the animationDidStop event) .

the problem is that the touchesBegan doesn't work when i touch the current position of the imageview. it works only when i touch the original frame (where it was created).

My suggestion is that touchesBegan not applying on the presentationLayer, but on the original frame .

Do you have a way of solving this issue ?? I really would like to solve this from within the Customer class , and not from the开发者_JAVA技巧 main UIViewController .

Thanks a lot, Shahar.


Have you enabled userInteraction flag to YES for Customer class.

Thanks,

0

精彩评论

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

关注公众号