我有一个类似下面的课程
class MainVC: UIViewController {
lazy var someBtn: UIButton = {
let button = UIButton(type: .system)
button.translatesAutoresizingMaskIntoConstraints = false
button.isHidden = true
button.addTarget(self, action: #selector(didPressBtn), for: .touchUpInside)
return button
}()
}
我将MainVC子类化,当我尝试覆盖someBtn时,错误消息显示为Getter for 'someBtn' with Objective-C selector 'someBtn' conflicts with getter for 'someBtn' from superclass 'MainVC' with the same Objective-C selector
class SecondVC: MainVC {
override var someBtn:UIButton = {
return UIButton()
}
}