Skip to content

Commit

Permalink
Conform DefaultMessageContentPresenter to MessageContentLoadingPresen…
Browse files Browse the repository at this point in the history
…terProtocol
  • Loading branch information
wiruzx committed Oct 26, 2023
1 parent 4efed8f commit 43364b0
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
// THE SOFTWARE.

import UIKit
import Chatto

public final class DefaultMessageContentPresenter<MessageType, ViewType: UIView>: MessageContentPresenterProtocol {
public final class DefaultMessageContentPresenter<MessageType, ViewType: UIView>: MessageContentPresenterProtocol, MessageContentLoadingPresenterProtocol {

public typealias ActionHandler = (_ message: MessageType, _ view: ViewType?) -> Void
public typealias BindingClosure = (_ message: MessageType, _ view: ViewType?) -> Void
Expand All @@ -37,7 +38,8 @@ public final class DefaultMessageContentPresenter<MessageType, ViewType: UIView>
onContentWillBeShown: ActionHandler? = nil,
onContentWasHidden: ActionHandler? = nil,
onContentWasTapped_deprecated: ActionHandler? = nil,
onMessageUpdate: MessageUpdateClosure? = nil) {
onMessageUpdate: MessageUpdateClosure? = nil,
contentLoadingStatus: Observable<MessageContentLoadingStatus> = .init(.loaded)) {
self.message = message

self.onBinding = onBinding
Expand All @@ -49,6 +51,7 @@ public final class DefaultMessageContentPresenter<MessageType, ViewType: UIView>
self.onContentWasTapped_deprecated = onContentWasTapped_deprecated

self.onMessageUpdate = onMessageUpdate
self.contentLoadingStatus = contentLoadingStatus
}

private var message: MessageType
Expand All @@ -64,6 +67,10 @@ public final class DefaultMessageContentPresenter<MessageType, ViewType: UIView>

private let onMessageUpdate: MessageUpdateClosure?

// MARK: - MessageContentLoadingPresenterProtocol

public let contentLoadingStatus: Observable<MessageContentLoadingStatus>

// MARK: - MessageContentPresenterProtocol

public weak var delegate: MessageContentPresenterDelegate?
Expand Down

0 comments on commit 43364b0

Please sign in to comment.