UIAlertController Basics import UIKit class ViewController: UIViewController { override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) showAlert() } func showAlert() { let alert = UIAlertController(title: "Notifications Disabled", message: "For the best chat experience needs notification", preferredStyle: .alert) alert.addAction(UIAlertAction(title: "OK", style: .default, handler: nil)) alert.addAction(UIAlertAction(title: "Settings", style: .cancel, handler: nil)) present(alert, animated: true, completion: nil) } } How to programmatically dismiss if let _ = presentedViewController as? UIAlertController { dismiss(animated: true, completion: nil) } Number of buttons One or two buttons will be placed side-by-side. Three buttons or more it will want to stack. Links that help Apple docs Human Interface Guidelines