臨時吐司般的彈出
適用於不需要互動的快速通知。
迅速
let alert = UIAlertController(title: "Toast", message: "Hello World", preferredStyle: .Alert)
presentViewController(alert, animated: true) {
let delay_s:Double = 2
let delayTime = dispatch_time(DISPATCH_TIME_NOW, Int64(delay_s * Double(NSEC_PER_SEC)))
dispatch_after(delayTime, dispatch_get_main_queue()) {
alert.dismissViewControllerAnimated(true, completion: nil)
}
}