当用户将文本字段留空时,我正在try 弄清楚如何使文本字段在按下按钮时抖动.
我目前有以下代码在工作:
if self.subTotalAmountData.text == "" {
let alertController = UIAlertController(title: "Title", message:
"What is the Sub-Total!", preferredStyle: UIAlertControllerStyle.Alert)
alertController.addAction(UIAlertAction(title: "Okay", style: UIAlertActionStyle.Default,handler: nil))
self.presentViewController(alertController, animated: true, completion: nil)
} else {
}
但我认为,让文本字段震动作为一种提醒会更有吸引力.
我找不到任何可以为文本字段添加动画的内容.
有什么主意吗?
谢谢