如何在按下按钮时以编程方式使用 swift 关闭键盘?
最佳答案
还有所谓的“大锤子”。
只需调用self.view.endEditing(true)
文档说明了此方法的以下内容:
Causes the view (or one of its embedded text fields) to resign the first responder status.
关于ios - 按下按钮时以编程方式快速关闭键盘?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31952064/