Questions tagged [cadisplaylink]

A CADisplayLink object is a timer object that allows your application to synchronize its drawing to the refresh rate of the display.

137 questions
1
vote
1 answer

CADisplayLink because of remove(from:forMode:) not deallocating view controller

I am facing one strange issue. So I have created instance and allocated like below var displayLink:CADisplayLink? private func setupDisplayLink () { self.displayLink = CADisplayLink(target: self, selector:…
Prashant Tukadiya
  • 15,838
  • 4
  • 62
  • 98
1
vote
1 answer

CADisplayLink in a DispatchQueue

I am trying to run a display link in a thread other than main but it simply doesn't work. I have a simple dispatch queue created like queue = DispatchQueue(label: "xyz") and then I create the display link as usual: queue.async { self.displayLink =…
1
vote
2 answers

Metronome. Timer, music and animations

I develop an app where a user have few cells in which he can put sounds and then playing the built sequence. There is a metronome, it can tick with sound. Users can set metronome speed, that is the same that to set speed of passing to the next…
1
vote
0 answers

iOS Frame Processing Time Computation

For context, I want to measure the scroll performance in one of my views. Right now, I have a fair idea based on render cycle notifications using CADisplayLink API. I wish to understand more accurately the time it requires to process a frame. This…
p0lAris
  • 4,750
  • 8
  • 45
  • 80
1
vote
1 answer

Why does animation jitter when CATransactions begin and end at about the same time?

Problem How can I fix the jitter in my scrolling animation? As seen in the animations below, there is a brief jitter every time the notes (black ovals) reach the vertical blue line, which makes it appear that the notes went backwards for a split…
1
vote
1 answer

CADisplayLink behaves similar to NSTimer, framerate bug

I have implemented CADisplayLink, but yet it behaves similar to NSTimer in that when there are a lot of draws it locks the fps to 40 and never gets out of there, even if there are a lot fewer draws afterward. This happens on the itouch 3 and itouch…
avide
  • 61
  • 1
  • 2
1
vote
1 answer

OpenGL Rendering not Resuming after App Backgrounded

I am using OpenGL ES to render a scene on a CADisplayLink with: self.displayLink = CADisplayLink(target: self, selector: #selector(self.updateOpenGL)) self.displayLink!.frameInterval = 1 self.displayLink!.addToRunLoop(NSRunLoop.currentRunLoop(),…
Jeshua Lacock
  • 5,730
  • 1
  • 28
  • 58
1
vote
2 answers

How to pause a CADisplayLink?

I have a problem in my app. What I want to happened is when I click button2, it disappears and stops moving. What's happening now is that when I click button2, it disappears but doesn't stop moving (even while its hidden).Any help? Code: @IBOutlet…
Anton O.
  • 653
  • 7
  • 27
1
vote
1 answer

CADislayLink does not trigger if device is locked

EDIT: Using CADislayLink to monitor the AVAudioRecorder meters is not a good idea if app run in background. It stops triggering if device sleeps (in my case is locking the device). The solution for that is using NSTimer instead. Here is the code…
nahung89
  • 7,745
  • 3
  • 38
  • 40
1
vote
1 answer

How To Apply Complex CALayer Transform Changes?

I need a complex continuous animation of a UIView that involves setting CATransform3D rotation and translation properties that need to be calculated, so a standard animation is no option. I turned to using CALayer animation. And have…
meaning-matters
  • 21,929
  • 10
  • 82
  • 142
1
vote
1 answer

How to use a for-in-loop to make multiple objects in a CADisplayLink

So I am trying to create 10 buttons by using a for in loop and make all those 10 buttons move down using a CADisplayLink. The problem is that my CADisplayLink only moves one of the buttons down and I want it to move all 10 of the buttons. Please…
Garret Kaye
  • 2,412
  • 4
  • 21
  • 45
1
vote
1 answer

How to prevent UIAnimation from interfering with CADisplayLink

In my current project there are two main mechanics. A series of objects that continually move up the screen, and a mechanic where you press multiple buttons to move 2 objects. For the series of objects that move up the screen, i have utilized a…
1
vote
1 answer

Stuttering animation whilst using CADisplayLink

I am trying to animate some UIImageViews to 'fall' down the page using CADisplayLink to call a MoveObjects function. However, despite the function calls being at consistent 0.0155-0.017s intervals, the animation appears to stutter every few frames,…
1
vote
1 answer

iOS - Detecting change of contents of CALayer

I have a CALayer which has a CAKeyFrameAnimation. Is there a way to detect the change of contents of CALayer? It's like, whenever the contents (image) of CALayer is changed due to CAKeyFrameAnimation, I want to play a short sound with…
Woonohyo
  • 23
  • 3
1
vote
0 answers

What causes CADisplayLink to fire only sporadically/get delayed?

Maybe you don't need all this information to help me with this problem. The core questions is: What can cause a CADisplayLink to delay firing, and how to check for possible reasons? I'm using a CADisplayLink timer to velocity-/inertia-scroll my own…
Daniel S.
  • 6,458
  • 4
  • 35
  • 78