Search code examples
iosopengl-esuiviewanimationuiviewanimationtransition

View transitions slowed down on adding OpenGL view


Facing a really, really weird problem with an OpenGL View we are using in our app to perform some custom animations. As soon as the Open GL View is added into the project, all native View animations slow down. And by slow down I don't mean a drop in frame rate. The animations are stutter-free, except much much MUCH slower than normal (like someone enabled "Toggle Slow Animations" in the Simulator).

This is affecting only view transitions animations, for example: a. transitionFromView b. presentViewController (iOS6, or presentModalViewController on earlier)

While regular UIView Animations, CABasicAnimation etc proceed at the regular pace.

I haven't seen anything like this, and the results honestly have to be seen to be believed. :) But any idea what the problem could be (I'm not sure which piece of the code would help you debug, and I'm unfortunately not in a position to share screenshots or video)


Solution

  • Found the solution accidentally several days later.

    The problem turned out to be much sillier and unrelated. It so happens that if you have a UIView beginAnimation block that is not closed properly, future animations get all wonky. This faultily coded animation happened to be triggered at more or less the same time as the OpenGL view was being initialized, which led to my erroneous belief that the OpenGL View was at the root of this.

    Thanks for the help!