繁体   English   中英

iOS UICollectionViewCell 删除定时器

[英]iOS UICollectionViewCell remove timer

我在 UICollectionViewCell 中有一个计时器,

timer = Timer.scheduledTimer(timeInterval: 5, target: self, selector: #selector(shakeView), userInfo: nil, repeats: true)

现在我想在 controller 消失时删除计时器,但未调用单元 deinit

不调用 Deinit 方法,因为它具有保留周期。 检查所有闭包并确保使用弱自我或无主自我。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM