Open Dialogue box in Swift using UIAlertController


let alert = UIAlertController(title:"Title", message: "Hello, How are you?", preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: "YES", style: .default, handler: { (UIAlertAction) in
      // write code when you click yes button
}))
alert.addAction(UIAlertAction(title: "NO", style: UIAlertActionStyle.default, handler: nil))
self.present(alert, animated: true, completion: nil)