0

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)

Brad Larson
  • 170,088
  • 45
  • 397
  • 571
Dev Kanchen
  • 2,332
  • 3
  • 28
  • 40

2 Answers2

0

It seems like the animation gets stuck while loading the OpenGL View, debug the Lifecycle methods like loadView, viewWillLoad. The loadview, etc. happens within the transition animation, maybe you can solve the slow animation by sending most of the loading code in to a custom method which you call in viewdidload or viewdidappear.

It does not interrupt any other animation because thats a totally new action in the queue.

Hope this helps!

Fry
  • 922
  • 2
  • 10
  • 24
0

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!

Dev Kanchen
  • 2,332
  • 3
  • 28
  • 40