📅  最后修改于: 2022-03-11 15:00:59.388000             🧑  作者: Mango
#if canImport(UIKit)
extension View {
func hideKeyboard() {
UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
}
}
#endif