I have encountered this warning:
pushViewController:animated: called on while an existing transition or presentation is occurring; the navigation stack
Add the code of navigate controller on the ok action button handler. When Tap on ok button navigate the view controller
let okActionBtn = UIAlertAction(title: "Ok", style: .default, handler: {
self.navigationController?.popViewController(animated: true)
})
let cancelActionBtn = UIAlertAction(title: "Cancel", style: .cancel, handler: nil)
let alert = UIAlertController(title: "Title", message: "Message", preferredStyle: .alert)
alert.addAction(okActionBtn)
alert.addAction(cancelActionBtn)
self.present(alert, animated: true)