I have a timer in UICollectionViewCell,
timer = Timer.scheduledTimer(timeInterval: 5, target: self, selector: #selector(shakeView), userInfo: nil, repeats: true)
now I want to remove timer when controller disapper, but cell deinit not called
I have a timer in UICollectionViewCell,
timer = Timer.scheduledTimer(timeInterval: 5, target: self, selector: #selector(shakeView), userInfo: nil, repeats: true)
now I want to remove timer when controller disapper, but cell deinit not called
Deinit method is not called because it has retain cycle. Check all the closures and make sure you use weak self or unowned self.