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: #selector(displayLinkDidFire(link:)))
self.displayLink?.preferredFramesPerSecond = 30
self.displayLink?.add(to: .main, forMode: .common)
}
Now to remove display link I have from this Answer
self.displayLink?.remove(from: .main, forMode: .common) // comment this line and view controller correctly deallocated
self.displayLink?.invalidate()
because of line self.displayLink?.remove(from: .main, forMode: .common)
my deinit
method not called of view controller
In memory graph I am not able to identify the real problem. I was lucky that I have tried to comment that line and it works
Why that so ?