What is the proper way to make CADisplayLink
callback functions run on a background thread? I'm creating the Display Link with:
let displayLink = CADisplayLink(target: self, selector: #selector(self.renderBackground))
if let displayLink = displayLink {
displayLink.preferredFramesPerSecond = 30
DispatchQueue.main.async {
displayLink.add(to: .current, forMode: .common)
}
}
This works, but when I add a breakpoint to the renderBackground function, it shows it is on the Main thread:
It appears to be on the main thread?