CreationKit Documentation

Class Failed​Message

public class FailedMessage: MessageType, Equatable  

Insert this MessageType when a message fails to send.

The user will be given the change to resend this message. When it's passed back to you in MessageViewController.resend(failedMessage:, completion:), it is important to call the completion closure so that the controller can update the UI.

FailedMessage FailedMessage MessageType MessageType FailedMessage->MessageType Equatable Equatable FailedMessage->Equatable

Conforms To

Equatable
MessageType

Initializers

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

public init(sender: Sender, kind: MessageKind, sentDate: Date = Date())  

Creates a system message.

Prefer to use the make factory method over this method.

Parameters

style

The style of the message.

sent​Date Date

The date of the message. Defaults to now.

Properties

sender

public var sender: Sender

message​Id

public var messageId: String = UUID().uuidString

sent​Date

public var sentDate: Date

kind

public var kind: MessageKind

was​Successfully​Sent

public internal(set) var wasSuccessfullySent: Bool = false

Update this to true when the message is resent successfully.

Methods

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

public static func make(sender: Sender, kind: MessageKind, sentDate: Date = Date()) -> FailedMessage  

Creates a system message.

Parameters

style

The style of the message.

sent​Date Date

The date of the message. Defaults to now.

make(from:​sent​Date:​)

public static func make(from other: MessageType, sentDate: Date = Date()) -> FailedMessage  

Converts some MessageType to a FailedMessage.

Operators

==

public static func == (lhs: FailedMessage, rhs: FailedMessage) -> Bool