在UIView子类中,我是覆盖BecomeFirstResponder(返回一个Bool.
class MyViewSubclass:UIView {
...
override func becomeFirstResponder() -> Bool {
// some stuff
return super.becomeFirstResponder()
}
...
}
Run Code Online (Sandbox Code Playgroud)
在子类的对象上调用此方法时,我收到警告Result of call to 'becomeFirstResponder()' is Unused.
当我不覆盖时,不会发生此消息becomeFirstResponder.
我知道,与斯威夫特3的方法返回结果已经演变行为(见@discardableResult的SE-0047),但我希望一个覆盖有相同的行为,其超强的方法.
我错了认为或者它可能是编译器错误?
| 归档时间: |
|
| 查看次数: |
1424 次 |
| 最近记录: |