mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-02 06:06:57 +02:00
Fix scroll issues with VoiceBroadcastPlayback cells (by fixing SizableBaseRoomCell)
This commit is contained in:
@@ -65,6 +65,12 @@ class SizableBaseRoomCell: BaseRoomCell, SizableBaseRoomCellType {
|
||||
|
||||
return self.height(for: roomBubbleCellData, fitting: maxWidth)
|
||||
}
|
||||
|
||||
override func prepareForReuse() {
|
||||
cleanContentVC()
|
||||
|
||||
super.prepareForReuse()
|
||||
}
|
||||
|
||||
// MARK - SizableBaseRoomCellType
|
||||
|
||||
@@ -173,10 +179,21 @@ class SizableBaseRoomCell: BaseRoomCell, SizableBaseRoomCellType {
|
||||
}
|
||||
|
||||
return height
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private func cleanContentVC() {
|
||||
contentVC?.removeFromParent()
|
||||
contentVC?.view.removeFromSuperview()
|
||||
contentVC?.didMove(toParent: nil)
|
||||
contentVC = nil
|
||||
}
|
||||
|
||||
// MARK: - Public
|
||||
|
||||
func addContentViewController(_ controller: UIViewController, on contentView: UIView) {
|
||||
controller.view.invalidateIntrinsicContentSize()
|
||||
|
||||
cleanContentVC()
|
||||
|
||||
let parent = vc_parentViewController
|
||||
parent?.addChild(controller)
|
||||
@@ -185,13 +202,4 @@ class SizableBaseRoomCell: BaseRoomCell, SizableBaseRoomCellType {
|
||||
|
||||
contentVC = controller
|
||||
}
|
||||
|
||||
override func prepareForReuse() {
|
||||
contentVC?.removeFromParent()
|
||||
contentVC?.view.removeFromSuperview()
|
||||
contentVC?.didMove(toParent: nil)
|
||||
contentVC = nil
|
||||
|
||||
super.prepareForReuse()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user