问题描述:

I have 2 UIViewControllers, the first controller to load data from server, and then go to the second controller. When 2nd controller needs to fetch more data, it will go back to 1st controller. 1st controller has reference of 2nd, and vice versa.

But when I try to call the 1st controller again from 2nd controller, it shows error 'Application tried to present modally an active controller'

Here is how I call the 1st Controller for 2nd time

self.presentViewController(firstController!, animated: true, completion: nil)

This code also produce the same error

UIApplication.sharedApplication().keyWindow?.bringSubviewToFront(firstController!.view)

相关阅读:
Top