BaseBubbleCell: Add default support for RoomCellURLPreviewDisplayable.

This commit is contained in:
SBiOSoftWhare
2022-02-07 16:14:37 +01:00
parent c848909219
commit 719b837b4c
@@ -178,6 +178,10 @@ class BaseBubbleCell: MXKRoomBubbleTableViewCell, BaseBubbleCellType {
if let timestampDisplayable = self as? TimestampDisplayable {
timestampDisplayable.removeTimestampView()
}
if let urlPreviewDisplayable = self as? RoomCellURLPreviewDisplayable {
urlPreviewDisplayable.removeURLPreviewView()
}
}
override func render(_ cellData: MXKCellData!) {
@@ -234,6 +238,17 @@ class BaseBubbleCell: MXKRoomBubbleTableViewCell, BaseBubbleCellType {
self.bubbleCellContentView = bubbleCellContentView
}
// MARK: - RoomCellURLPreviewDisplayable
// Cannot use default implementation with ObjC protocol, if self conforms to BubbleCellReadReceiptsDisplayable method below will be used
func addURLPreviewView(_ urlPreviewView: UIView) {
self.bubbleCellContentView?.addURLPreviewView(urlPreviewView)
}
func removeURLPreviewView() {
self.bubbleCellContentView?.removeURLPreviewView()
}
// MARK: - BubbleCellReadReceiptsDisplayable
// Cannot use default implementation with ObjC protocol, if self conforms to BubbleCellReadReceiptsDisplayable method below will be used