@IBAction func submitButtonDown(_ sender: AnyObject) {
if !self.arrivalCityField.hasText {
singleTon.shouldNotSubmitForm()
}
if singleTon.canSubmitForm() {
self.endEditing(true)
self.submitButton.sendActions(for: .touchUpInside) //Ends up looping forever, I need this to run after the current execution has finished but only once... (that is tap once, wait, then programatically tap another time.
}
在IBAction
功能运行完毕后,有没有办法在同一个按钮上模拟另一个触摸?
我尝试过使用GCD
,但它会继续循环播放......