0
Ich möchte 3 Sekunden in meinem Alarm-Controller Countdown. Ich bin mir nicht sicher, wie ich das machen soll. Ich kann die Warnung in 3 Sekunden verschwinden lassen, nur der Countdown fehlt.Countdown in UIAlertController
//simple alert dialog
let alertController = UIAlertController(title: "Workflow successful", message: "Modified reminder's priority or list.", preferredStyle: .Alert)
var secs = 3
let defaultAction = UIAlertAction(title: "Dismiss in " + secs, style: .Default, handler: nil)
alertController.addAction(defaultAction)
dispatch_async(dispatch_get_main_queue()) {
//self.presentViewController(alertController, animated: true, completion: nil)
self.showViewController(alertController, sender: self)
}
let delayTime = dispatch_time(DISPATCH_TIME_NOW,
Int64(secs * Double(NSEC_PER_SEC)))
dispatch_after(delayTime, dispatch_get_main_queue()) {
alertController.dismissViewControllerAnimated(true, completion: nil)
}