Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The answer at the following post works very well for me (it appears to be quite similar to Till's answer):</p> <p><a href="https://stackoverflow.com/a/2742275/396999">UIScrollView pauses NSTimer until scrolling finishes</a></p> <p>To summarize: disable the CADisplayLink or GLKViewController render loop when the UIScrollView appears and start a NSTimer to perform the update/render loop at the desired framerate. When the UIScrollView is dismissed/removed from the view hierarchy, re-enable the displayLink/GLKViewController loop.</p> <p>In the GLKViewController subclass I use the following code</p> <p>on appear of UIScrollView:</p> <pre><code>// disable GLKViewController update/render loop, it will be interrupted // by the UIScrollView of the MPMediaPicker self.paused = YES; updateAndRenderTimer = [NSTimer timerWithTimeInterval:1.0f/60.0f target:self selector:@selector(updateAndRender) userInfo:nil repeats:YES]; [[NSRunLoop mainRunLoop] addTimer:updateAndRenderTimer forMode:NSRunLoopCommonModes]; </code></pre> <p>on dismiss of UIScrollView:</p> <pre><code>// enable the GLKViewController update/render loop and cancel our own. // UIScrollView wont interrupt us anymore self.paused = NO; [updateAndRenderTimer invalidate]; updateAndRenderTimer = nil; </code></pre> <p>Simple and effective. I'm not sure if this could cause artifacts/tearing of some sort since the rendering is decoupled from screen refreshes, but using CADisplayLink with NSRunLoopCommonModes totally breaks the UIScrollView in our case. Using NSTimer looks just fine for our app and definitely a whole lot better than no rendering.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload