I have an iOS application using storyboard and Swift. I’m trying to call a storyboard, and in the new view controller, I receive the error:
2024-04-29 15:40:46.156969-0300 MyQiwi[2464:54321] [Presentation] Attempt to present <UINavigationController: 0x7fcef133d800> on <UINavigationController: 0x7fceeeb1fa00> (from <UINavigationController: 0x7fceeeb1fa00>) whose view is not in the window hierarchy.
I’m forcing the code to run on the main thread.
Code:
extension TaxaLayoutFormViewController: BaseDelegate {
func onReceiveData(fromClass: AnyClass, param: Int, result: Bool, object: AnyObject?) {
DispatchQueue.main.async {
if param == Param.Contact.TAXA_GET_CAMPO_TAXA_RESPONSE {
self.dismissPage(nil)
if result {
self.executeOrder(response: object as! GetTaxasResponse)
}
}
}
}
}
extension TaxaLayoutFormViewController {
func executeOrder(response: GetTaxasResponse)
{
self.performSegue(withIdentifier: Constants.Segues.LIST_GENERIC, sender: nil)
}
}
The identifier used in performSegue is already linked in the storyboard. I tested by calling performSegue from viewDidLoad, and it worked correctly.
The same structure is used in other viewControllers and works correctly. I don’t know why, in this storyboard, it returns the error.
Daniel Catini is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.