Class
FailedMessage
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.
Relationships
Conforms To
Equatable
MessageType
Initializers
init(sender:kind:sentDate:)
public init(sender: Sender, kind: MessageKind, sentDate: Date = Date())
Creates a system message.
Prefer to use the make
factory method over this method.
Parameters
Name | Type | Description |
---|---|---|
style | The style of the message. |
|
sentDate | Date |
The date of the message. Defaults to now. |
Properties
sender
public var sender: Sender
messageId
public var messageId: String = UUID().uuidString
sentDate
public var sentDate: Date
kind
public var kind: MessageKind
wasSuccessfullySent
public internal(set) var wasSuccessfullySent: Bool = false
Update this to true when the message is resent successfully.
Methods
make(sender:kind:sentDate:)
public static func make(sender: Sender, kind: MessageKind, sentDate: Date = Date()) -> FailedMessage
Creates a system message.
Parameters
Name | Type | Description |
---|---|---|
style | The style of the message. |
|
sentDate | Date |
The date of the message. Defaults to now. |
make(from:sentDate:)
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