我试图弄清楚当用户将文本字段留空时如何在按钮按下时使文本摇动.
我目前有以下代码工作:
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 {
}
Run Code Online (Sandbox Code Playgroud)
但我认为将文本字段震动作为警报会更具吸引力.
我找不到任何动画文本字段的动画.
有任何想法吗?
谢谢!