OGeek|极客世界-中国程序员成长平台

标题: ios - 为多个控件事件 UIButton 添加选择器 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 07:59
标题: ios - 为多个控件事件 UIButton 添加选择器

我可以在一行中添加多个控件事件的选择器吗?

类似于 [_recordButton addTarget:self actionselector(myaction forControlEvents[UIControlEventTouchDragExit,UIControlEventTouchUpInside]];



Best Answer-推荐答案


控制事件是位标志:

[_recordButton addTarget:self actionselector(myaction forControlEvents:UIControlEventTouchDragExit|UIControlEventTouchUpInside];

关于ios - 为多个控件事件 UIButton 添加选择器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24042409/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4