我在Swift 3中对用Objective-C编写的UIButton
个子类进行了分类.
当我try 添加目标时,它失败,并显示错误代码:
class ActionButton: JTImageButton {
func action() {
}
func configure()) {
// ...
self.addTarget(self, action: #selector(self.action()), for: .touchUpInside)
// error:
// Argument of '#selector' does not refer to an '@objc' method, property, or initializer
}
}