I'm trying to find memory issues in my swift app. Found some by checking if deinit is called (strong reference in delegates for example) but checking UITableViewCell's or UICollectionViewCell's I don't see deinit never being called.
I have a really simple cell where I use:
Update:
Checked if tableView is calling it's deinit but it's not. So UIViewController calls it's deinit but tableView is still in memory.
Update 2:
Found the issue. A guard let was keeping an strong reference to the tableView in a helper function.
Since tableview cells are reused, they tend to be only deinited if the tableview itself is deinited. Because even if they are not used right now, the tableview would keep them alive in case they are needed for reuse.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With