所以我刚刚更新到swift 1.2,现在我的代码辞职键盘不能正常工作?
代码是:
override func touchesBegan(touches:NSSet, withEvent event: UIEvent) {
self.view.endEditing(true)
错误说覆盖方法有选择器" touchesBegan:withEvent:"具有不兼容的类型
答案 0 :(得分:0)
尝试将NSSet
替换为Set<NSObject>
override func touchesBegan(touches: Set<NSObject>, withEvent event: UIEvent) {
self.view.endEditing(true)
}
语法已在swift 1.2中编辑。 NSSet
替换为Set<NSObject>