How present the same viewcontroller many times

Hi! I learned about transitions with viewcontrollers with the iOS Animations_by_tutorials book, now I want to presenting a viewcontroller many times, the only that change is the data, it is like that the netflix app do, I know how make the transition, but that I don’t know how call the same viewcontroller itself, without it crashing y show the error : " Application tried to present modally an active controller"


Hi @armi,
You will have to instantiate the viewController manually and pass it the data.

The error that you are describing is because you may be trying to present the same instance instead of a new one.

You can instantiate a new one using the storyboardAPI function called instantiateViewController(withIdentifier: "YOUR_VC_NAME")
and then present this viewcontroller modally.


This topic was automatically closed after 166 days. New replies are no longer allowed.