对按钮向上和向下执行不同的操作
好的。我一直在努力寻找一种捕获按钮向上和向下操作的方法。我什至不确定 Xcode 中对此的正确术语是什么。这在 MS Visual 中非常简单,但我似乎无法找到如何使用 Xcode 来做到这一点。
本质上,我想在按下并按住按钮时触发一个动作,然后在释放按钮时触发另一个动作。
我不太确定该怎么做。任何提示或正确方向的指示将不胜感激!
Ok. I've been digging around trying to find a way to capture button up and down actions. I'm not even sure what the proper terminology in Xcode for this would be. It's pretty easy in MS Visual, but I can't seem to find how to do this with Xcode.
Essentially, I want to fire an action when the button is pressed down and held, and then another when the button is released.
I'm not really sure how to go about this. Any hints, or pointers in the right direction would be greatly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您没有指定,所以我假设这是针对 Mac 而不是 iOS。您应该阅读
NSResponder
文档。你可以用它做你想做的事。You didn't specify, so I'm going to assume this is for the Mac and not iOS. You should read the
NSResponder
documentation. You can do exactly what you want with that.