How can I detect a touch on an animated subview ? Or click an animated UIButton?

风流意气都作罢 提交于 2019-12-11 11:08:00

问题


I have a view that is moving. The view is sometimes on and sometimes off screen - it is twice the width of the screen. In this view, there are buttons that I need to be able to click. I've tried doing this in many ways already - using pure buttons using touches began on UIView

I'm doing the animation using a CGPath in core animation

Any help would be most appreciated

Thanks


回答1:


Whether the view is moving or not should irrelevent to the touch detection. If you have a UIButton object and are handling the UIEventControlTouchUpInside (forgot the exact name) event , it should be called when it sees a touch. Is that not working for you?



来源:https://stackoverflow.com/questions/2412787/how-can-i-detect-a-touch-on-an-animated-subview-or-click-an-animated-uibutton

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!