I have an alert whose OK button should pop to the root view controller.
Here's the structure of what I'm working with:
[tab view controller] -> [navigation controller] -> [view controller] -> [view controller] -> [navigation controller] -> [view controller] -> [alert]
I would like the OK button on the alert take me to the view controller I've bolded above. When I do the code below, I go back to the view controller I've italicized above, which isn't quite what I want. Any help would be much appreciated! Thanks!
alert.addAction(UIAlertAction(title: OK, style: UIAlertActionStyle.default, handler: { action in
DispatchQueue.main.async(execute: {
_ = self.dismiss(animated: true, completion: nil)
})
}))
I have also tried using the special method for popping to the root view controller, but this has not worked, sadly.
[view controller] -> [view controller]
, the segue type as PUSH or present