SPChat

public class SPChat : Object

Data object representing a chat conversation

  • id

    Identifier of the conversation

    Declaration

    Swift

    @objc
    public dynamic var id: String
  • The SPGateway used for the transfer of the messages

    Declaration

    Swift

    @objc
    public dynamic var gateway: SPGateway?
  • The other party of the conversation

    Declaration

    Swift

    public var secondParty: SPNumber { get set }
  • A list of all the SPMessages of the conversation

    Declaration

    Swift

    public let messages: <<error type>>
  • Initializes a SPChat object

    Declaration

    Swift

    public convenience init(with secondParty: SPNumber, on gateway: SPGateway, messages: [SPMessage])
    Parameters
    secondParty

    The other party of the conversation

    gateway

    The SPGateway used for the transfer of the messages

    messages

    A list of all the SPMessages of the conversation

  • Defines the primary key of the object

    Declaration

    Swift

    override public static func primaryKey() -> String?
    Return Value

    String representation of the primary key

  • Defines ignored properties by Realm

    Declaration

    Swift

    override public static func ignoredProperties() -> [String]
    Return Value

    String array of the properties names

  • Gives back the most recent message of the all the messages in the conversation

    Declaration

    Swift

    public func latestMessage() -> SPMessage?
    Return Value

    The most recent SPMessage

  • Checks whether a SPChat suites a given search term

    Declaration

    Swift

    public func matches(_ searchTerm: String) -> Bool
    Parameters
    searchTerm

    The string that should be matched

    Return Value

    Whether the chat is a appropriate search result