mirror of
https://github.com/neon443/StickerSlack.git
synced 2026-11-30 20:54:51 +00:00
fix memory leak
This commit is contained in:
1 file changed
+8
-2
@@ -18,7 +18,7 @@ class EmojiCell: UITableViewCell {
|
|||||||
|
|
||||||
spinner.startAnimating()
|
spinner.startAnimating()
|
||||||
spinner.frame = frame
|
spinner.frame = frame
|
||||||
addSubview(spinner)
|
contentView.addSubview(spinner)
|
||||||
|
|
||||||
spinner.translatesAutoresizingMaskIntoConstraints = false
|
spinner.translatesAutoresizingMaskIntoConstraints = false
|
||||||
NSLayoutConstraint.activate([
|
NSLayoutConstraint.activate([
|
||||||
@@ -55,7 +55,13 @@ class EmojiCell: UITableViewCell {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override func prepareForReuse() {
|
override func prepareForReuse() {
|
||||||
spinner.removeFromSuperview()
|
|
||||||
super.prepareForReuse()
|
super.prepareForReuse()
|
||||||
|
|
||||||
|
hostingController?.view.removeFromSuperview()
|
||||||
|
hostingController = nil
|
||||||
|
if spinner.superview == nil {
|
||||||
|
contentView.addSubview(spinner)
|
||||||
|
}
|
||||||
|
spinner.startAnimating()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||