我创建了一个派生自UIImageView(类名Customer)的类。 在此Customer类中,我实现了“touchesBegan”方法。
此外,我将CABasicAnimation应用于Customer类的图层。 (动画只是移动imageview。这是必要的,因为我想跟踪animationDidStop事件。)
问题是当我触摸imageview的当前位置时touchesBegan不起作用。它仅在我触摸原始帧(创建它的位置)时才有效。
我的建议是,touchesBegan不会在presentationLayer上应用,而是在原始帧上。
你有办法解决这个问题吗? 我真的想从Customer类中解决这个问题,而不是从主UIViewController中解决这个问题。
非常感谢, 沙哈尔。
答案 0 :(得分:0)
您是否为userInteraction
课程YES
启用了Customer
。{/ p>
谢谢,