I need to know if there is any method in iOS which behaves like Toast messages in Android. That is, I need to display a message which is dismissed automatically after few se
For Swift 2.0 and considering https://stackoverflow.com/a/5079536/6144027
//TOAST
let alertController = UIAlertController(title: "", message: "This is a Toast.LENGTH_SHORT", preferredStyle: .Alert)
self!.presentViewController(alertController, animated: true, completion: nil)
let delayTime = dispatch_time(DISPATCH_TIME_NOW, Int64(2.0 * Double(NSEC_PER_SEC)))
dispatch_after(delayTime, dispatch_get_main_queue()) {
alertController.dismissViewControllerAnimated(true, completion: nil)
}