CreationKit Documentation

Structure Image​Message

public struct ImageMessage: MessageType  

Used in a MessagesViewController when it needs to show an image based message.

ImageMessage ImageMessage MessageType MessageType ImageMessage->MessageType

Conforms To

MessageType

Initializers

init(sender:​image:​sent​Date:​)

public init(sender: Sender, image: UIImage, sentDate: Date = Date())  

Creates an ImageMessage.

Parameters

sender Sender

The sender of the message.

image UIImage

The image to display

init(sender:​image​URL:​sent​Date:​)

public init(sender: Sender, imageURL: URL, sentDate: Date = Date())  

Creates an ImageMessage from a URL.

Parameters

sender Sender

The sender of the message.

image​URL URL

The URL to load as an image

Properties

sender

public var sender: Sender

message​Id

public var messageId: String = UUID().uuidString

sent​Date

public var sentDate: Date  

kind

public private(set) var kind: MessageKind

Methods

make(sender:​image:​sent​Date:​)

public static func make(sender: Sender, image: UIImage, sentDate: Date = Date()) -> ImageMessage  

Creates an ImageMessage.

Parameters

sender Sender

The sender of the message.

image UIImage

The image to display

make(sender:​image​URL:​sent​Date:​)

public static func make(sender: Sender, imageURL: URL, sentDate: Date = Date()) -> ImageMessage  

Creates an ImageMessage from a URL.

Parameters

sender Sender

The sender of the message.

image​URL URL

The URL to load as an image