CADisplayLink in a DispatchQueue

Asked by At

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 = CADisplayLink(target: self, selector: #selector(render))
  self.displayLink.add(to: .current, forMode: .common)

The selector never gets called. Upon checking the currentMode of the RunLoop I see it is nil. What am I missing?


0 Answers