我得到一个"方法不会覆盖其超类中的任何方法"对于a是第一响应者功能。我在网上看了这个,没有解决方案。你能不能帮我解决这个问题。这是代码。
public override func isFirstResponder() -> Bool {
// Return true if any of `self`'s subviews is the current first responder.
// Needs to unwrap the IBOutlets otherwise IBInspectable is crashing when using CardTextField because IBOutlets
// are not initialized yet when IBInspectable engine runs.
guard let numberInputTextField = numberInputTextField, let monthTextField = monthTextField, let yearTextField = yearTextField, let cvcTextField = cvcTextField else {
return false
}
return [numberInputTextField, monthTextField, yearTextField, cvcTextField]
.filter({$0.isFirstResponder})
.isEmpty == false
}
这是错误的图像
答案 0 :(得分:2)
尝试替换它:
public override func isFirstResponder() -> Bool {
用这个:
public override var isFirstResponder: Bool {