TextField使用numberPad類型鍵盤沒有收起的按鍵
1. 通過window收起鍵盤(已過期)
UIApplication.shared.keyWindow?.endEditing(true)
2. 使用UIResponder
UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
TextField使用numberPad類型鍵盤沒有收起的按鍵
UIApplication.shared.keyWindow?.endEditing(true)
UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)