Question

I have a viewController which displays a map with annotations. When I click on a bar button, another viewController is supposed to animate on top of that. This works, BUT, when the animation completes, the viewController in the back disappears. It reappears again when the animated viewController closes again.

Here is a video of what happens - hopefully that will make things more clear:

Let me know if I should include the code as well.

Was it helpful?

Solution

When you present a view controller it is expected to take the full screen. As such, the view controllers 'below' it have their views removed from the stack to save resources which are expected to not be required.

You can change your presented view controller to do something like:

  1. Either, don't be presented, just add a subview and animate it in.
  2. Or, pass an image of the original view to the presented view, this becomes the background and that presented view animates a subview in over the image background.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top