【发布时间】:2017-07-29 11:54:10
【问题描述】:
我有 isEnabled = false 的 TextField,
现在我正在尝试添加UILongPressGestureRecognizer
在 UITableViewCell 内部:
override func awakeFromNib() {
super.awakeFromNib()
let tap = UILongPressGestureRecognizer(target: userNameTextField, action: #selector(userNamelongPressAction))
self.addGestureRecognizer(tap)
}
但是我崩溃了
'NSInvalidArgumentException',原因:'-[UITextField userNamelongPressAction]: 无法识别的选择器发送到实例
我能做什么? 谢谢
【问题讨论】:
标签: ios swift uitextfield uitapgesturerecognizer