Structure
ImageMessage
public struct ImageMessage: MessageType
Used in a MessagesViewController when it needs to show an image based message.
Relationships
Conforms To
MessageType
Initializers
init(sender:image:sentDate:)
public init(sender: Sender, image: UIImage, sentDate: Date = Date())
Creates an ImageMessage.
Parameters
Name | Type | Description |
---|---|---|
sender | Sender |
The sender of the message. |
image | UIImage |
The image to display |
init(sender:imageURL:sentDate:)
public init(sender: Sender, imageURL: URL, sentDate: Date = Date())
Creates an ImageMessage from a URL.
Parameters
Name | Type | Description |
---|---|---|
sender | Sender |
The sender of the message. |
imageURL | URL |
The URL to load as an image |
Properties
sender
public var sender: Sender
messageId
public var messageId: String = UUID().uuidString
sentDate
public var sentDate: Date
kind
public private(set) var kind: MessageKind
Methods
make(sender:image:sentDate:)
public static func make(sender: Sender, image: UIImage, sentDate: Date = Date()) -> ImageMessage
Creates an ImageMessage.
Parameters
Name | Type | Description |
---|---|---|
sender | Sender |
The sender of the message. |
image | UIImage |
The image to display |
make(sender:imageURL:sentDate:)
public static func make(sender: Sender, imageURL: URL, sentDate: Date = Date()) -> ImageMessage
Creates an ImageMessage from a URL.
Parameters
Name | Type | Description |
---|---|---|
sender | Sender |
The sender of the message. |
imageURL | URL |
The URL to load as an image |