1
我正在看一個項目,我在幾年前在Swift 1中。在將我的代碼轉換爲Swift 3語法之後,我注意到一個錯誤,它說Method does not override any method from its superclass
。我知道它是因爲Set是舊的語法,但我用什麼替換它?這是該行:方法不會覆蓋任何方法從它的超類集<NSObject>
override func touchesBegan(_ touches: Set<NSObject>, with event: UIEvent) {
self.view.endEditing(true)
}
它現在'設置 '。 https://stackoverflow.com/a/26811892/1271826 –
Rob
代碼爲所有Swift版本在https://stackoverflow.com/questions/28771896/overriding-method-with-selector-touchesbeganwithevent-has-incompatible-type –