From d15fa2199e6a662296c3ef0782eef54d5f0bd6d3 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Wed, 11 Mar 2020 22:49:53 -0400 Subject: [PATCH] Fix attachments container more view not beign removed on cell reuse Closes #92 --- Tusker/Views/Attachments/AttachmentsContainerView.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Tusker/Views/Attachments/AttachmentsContainerView.swift b/Tusker/Views/Attachments/AttachmentsContainerView.swift index 66ba78f2..ee0801d0 100644 --- a/Tusker/Views/Attachments/AttachmentsContainerView.swift +++ b/Tusker/Views/Attachments/AttachmentsContainerView.swift @@ -19,6 +19,7 @@ class AttachmentsContainerView: UIView { var attachments: [Attachment]! let attachmentViews: NSHashTable = .weakObjects() + var moreView: UIView? var blurView: UIVisualEffectView? var hideButtonView: UIVisualEffectView? @@ -53,6 +54,7 @@ class AttachmentsContainerView: UIView { attachmentViews.allObjects.forEach { $0.removeFromSuperview() } attachmentViews.removeAllObjects() + moreView?.removeFromSuperview() if attachments.count > 0 { self.isHidden = false @@ -128,6 +130,7 @@ class AttachmentsContainerView: UIView { accessibilityElements.append(bottomRight) default: // more than 4 let moreView = UIView() + self.moreView = moreView moreView.backgroundColor = .secondarySystemBackground moreView.translatesAutoresizingMaskIntoConstraints = false moreView.isUserInteractionEnabled = true