NotificationCollection

open class NotificationCollection: BaseCollection
extension NotificationCollection: FeedChannelDelegate
extension NotificationCollection: ConnectionDelegate

An object that accesses the cache for the messages.

Since

4.6.0
  • Notification collection delegate.

    Declaration

    Swift

    open weak var delegate: NotificationCollectionDelegate?
  • Undocumented

    Declaration

    Swift

    open internal(set) var startingPoint: Int64
  • If true, there may be the messages on the next page.

    Declaration

    Swift

    open internal(set) var hasNext: Bool
  • If true, there may be the messages on the previous page.

    Declaration

    Swift

    open internal(set) var hasPrevious: Bool
  • Returns the succeeded notifications that are already loaded in memory.

    Declaration

    Swift

    open var succeededMessages: [BaseMessage]
  • Starts the message collection with the policy. The result of the

    Declaration

    Swift

    open func startCollection(
        initPolicy: NotificationCollectionInitPolicy,
        cacheResultHandler: MessageListHandler?,
        apiResultHandler: MessageListHandler?
    )

    Parameters

    initPolicy

    The policy for the message collection.

    cacheResultHandler

    The callback to call when the messages are loaded from the cache. The messages is the messages that are loaded from the cache. The error will be returned when the loading message failed.

    apiResultHandler

    The callback to call when the messages are loaded from the server. The messages is the messages that are loaded from the server. The error will be returned when the loading message failed.

  • Invalidates the object.

    Declaration

    Swift

    open func dispose()
  • Loads messages of the next page.

    Declaration

    Swift

    open func loadNext(completionHandler: @escaping MessageListHandler)

    Parameters

    completionHandler

    The callback to call when the load is complete. The error will be returned when the loading message failed.

  • Loads messages of the previous page.

    Declaration

    Swift

    open func loadPrevious(completionHandler: @escaping MessageListHandler)

    Parameters

    completionHandler

    The callback to call when the load is complete. The error will be returned when the loading message failed.

BaseChannelDelegate

FeedChannelDelegate

ConnectionDelegate