Fix attachments container more view not beign removed on cell reuse
Closes #92
This commit is contained in:
parent
fadddeda7f
commit
d15fa2199e
|
@ -19,6 +19,7 @@ class AttachmentsContainerView: UIView {
|
||||||
var attachments: [Attachment]!
|
var attachments: [Attachment]!
|
||||||
|
|
||||||
let attachmentViews: NSHashTable<AttachmentView> = .weakObjects()
|
let attachmentViews: NSHashTable<AttachmentView> = .weakObjects()
|
||||||
|
var moreView: UIView?
|
||||||
|
|
||||||
var blurView: UIVisualEffectView?
|
var blurView: UIVisualEffectView?
|
||||||
var hideButtonView: UIVisualEffectView?
|
var hideButtonView: UIVisualEffectView?
|
||||||
|
@ -53,6 +54,7 @@ class AttachmentsContainerView: UIView {
|
||||||
|
|
||||||
attachmentViews.allObjects.forEach { $0.removeFromSuperview() }
|
attachmentViews.allObjects.forEach { $0.removeFromSuperview() }
|
||||||
attachmentViews.removeAllObjects()
|
attachmentViews.removeAllObjects()
|
||||||
|
moreView?.removeFromSuperview()
|
||||||
|
|
||||||
if attachments.count > 0 {
|
if attachments.count > 0 {
|
||||||
self.isHidden = false
|
self.isHidden = false
|
||||||
|
@ -128,6 +130,7 @@ class AttachmentsContainerView: UIView {
|
||||||
accessibilityElements.append(bottomRight)
|
accessibilityElements.append(bottomRight)
|
||||||
default: // more than 4
|
default: // more than 4
|
||||||
let moreView = UIView()
|
let moreView = UIView()
|
||||||
|
self.moreView = moreView
|
||||||
moreView.backgroundColor = .secondarySystemBackground
|
moreView.backgroundColor = .secondarySystemBackground
|
||||||
moreView.translatesAutoresizingMaskIntoConstraints = false
|
moreView.translatesAutoresizingMaskIntoConstraints = false
|
||||||
moreView.isUserInteractionEnabled = true
|
moreView.isUserInteractionEnabled = true
|
||||||
|
|
Loading…
Reference in New Issue