Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果某个按钮被按住,我将如何编写代码来感知?以及如何将计时器添加到我的应用程序中?
问候,尼基塔。
听起来您正在寻找UILongPressGestureRecognizer。有了它,您可以配置一个 minimumPressDuration,它可以满足您对计时器的需求,如果没有,那么NSTimer很容易使用。