Temporary toast-like pop up

suggest change

Good for quick notifications that don’t require interaction.

Swift

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)
     }
}

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents