Wait for viewDidAppear()
:
This error can also arise if you are trying to present view controller before view actually did appear, for example presenting view in viewWillAppear()
or earlier.
Try to present another view after viewDidAppear()
or inside of it.