QuotedChatMessageView
A view that displays a quoted message.
open class QuotedChatMessageView: _View, ThemeProvider, SwiftUIRepresentable
Inheritance
_View
, SwiftUIRepresentable
, ThemeProvider
Nested Type Aliases
ObservedObject
Data source of QuotedChatMessageView
represented as ObservedObject
.
public typealias ObservedObject<Content: SwiftUIView> = SwiftUIWrapper<Content>
SwiftUIView
QuotedChatMessageView
represented in SwiftUI.
public typealias SwiftUIView = QuotedChatMessageViewSwiftUIView
Properties
content
The content of this view, composed by the quoted message and the desired avatar alignment.
public var content: Content?
isAttachmentsEmpty
A Boolean value that checks if all attachments are empty.
open var isAttachmentsEmpty: Bool
containerView
The container view that holds the authorAvatarView
and the contentContainerView
.
open private(set) lazy var containerView: ContainerStackView = ContainerStackView()
.withoutAutoresizingMaskConstraints
authorAvatarView
The avatar view of the author's quoted message.
open private(set) lazy var authorAvatarView: ChatAvatarView = components
.avatarView.init()
.withoutAutoresizingMaskConstraints
contentContainerView
The container view that holds the textView
and the attachmentPreview
.
open private(set) lazy var contentContainerView: ContainerStackView = ContainerStackView()
.withoutAutoresizingMaskConstraints
textView
The UITextView
that contains quoted message content.
open private(set) lazy var textView: UITextView = UITextView()
.withoutAutoresizingMaskConstraints
attachmentPreviewView
The attachments preview view if the quoted message has attachments. The default logic is that the first attachment is displayed on the preview view.
open private(set) lazy var attachmentPreviewView: UIImageView = UIImageView()
.withoutAutoresizingMaskConstraints
authorAvatarSize
The size of the avatar view that belongs to the author of the quoted message.
open var authorAvatarSize: CGSize
attachmentPreviewSize
The size of the attachments preview.s
open var attachmentPreviewSize: CGSize
Methods
setUp()
override open func setUp()
setUpAppearance()
override open func setUpAppearance()
setUpLayout()
override open func setUpLayout()
updateContent()
override open func updateContent()
setAvatar(imageUrl:)
Sets the avatar image from a URL or sets the placeholder image if the URL is nil
.
open func setAvatar(imageUrl: URL?)
Parameters
imageUrl
: The URL of the image.
setAvatarAlignment(_:)
Sets the avatar position in relation of the text bubble.
open func setAvatarAlignment(_ alignment: QuotedAvatarAlignment)
Parameters
alignment
: The avatar alignment of the author of the quoted message.
setAttachmentPreview(for:)
Sets the attachment content to the preview view. Override this function if you want to provide custom logic to present the attachments preview of the message, or if you want to support your custom attachment.
open func setAttachmentPreview(for message: ChatMessage)
Parameters
message
: The message that contains all the attachments.
setAttachmentPreviewImage(url:)
Sets the image from the given URL into attachmentPreviewView.image
open func setAttachmentPreviewImage(url: URL?)
Parameters
url
: The URL from which the image is to be loaded
showAttachmentPreview()
Show the attachment preview view.
open func showAttachmentPreview()
hideAttachmentPreview()
Hide the attachment preview view.
open func hideAttachmentPreview()