swift - Uitextfield通知xcode 12
解决方案
您的意思是显示一条消息说在前进之前必须填写文本字段吗?如果是这样,请在每个 textField 上使用 if 语句
if namaField.text == "" || alamatField.text == "" || phoneField.text == "" {
let alertController = UIALertController(title: "Enter all fields", preferredStyle: .alert)
let okayAction = UIAlertAction(title: "Okay", style: .default, handler: { action in
self.dismiss(animated: true, completion: nil)
})
alert.addAction(okayAction)
self.present(alert, animated: true)
}
推荐阅读
- c# - Blazor 服务器 SignalR:每 5 分钟在后台获取数据并更新所有客户端的 UI?
- python - Python脚本的多处理运行时错误
- arrays - awk 查找表,空白列替换
- c# - 这会将实体两次添加到数据库中吗?
- python - 如何在 Swagger-ui 文档中更改语言(多语言支持)
- angular - 从本地或从 Heroku/部署的服务器获取
- flutter - Flutter AppBarTheme 默认不应用于 AppBar
- javascript - 如何发送 args[2] 和之后的所有 args?
- rxjs - 间隔存储在哪里?
- python - 如何为父属性赋值并在继承函数中使用它?