gpt4 book ai didi

ios - 用 swift 删除键盘

转载 作者:行者123 更新时间:2023-11-30 13:55:22 27 4
gpt4 key购买 nike

我想在完成输入后通过点击开箱即用的任何位置来删除键盘,所以我写了这个

 override func touchesBegan(touches: Set<NSObject>, withEvent event: UIEvent!) {
self.view.endEditing(true)
}

但它说我没有重写 super 类中的任何方法。但是怎么会这样?:)

最佳答案

对于 Swift 2,使用:

override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?)

关于ios - 用 swift 删除键盘,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33697358/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com