Skip to content

Commit

Permalink
Make ChatChannelScreen init public (#618)
Browse files Browse the repository at this point in the history
  • Loading branch information
laevandus authored Oct 11, 2024
1 parent 2d3487f commit e5b0be1
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Sources/StreamChatSwiftUI/ChatChannel/ChatChannelScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@ import StreamChat
import SwiftUI

/// Screen component for the chat channel view.
public struct ChatChannelScreen: View {
public var chatChannelController: ChatChannelController
public struct ChatChannelScreen<Factory>: View where Factory: ViewFactory {
public let chatChannelController: ChatChannelController
private let viewFactory: Factory

public init(
chatChannelController: ChatChannelController,
viewFactory: Factory = DefaultViewFactory.shared
) {
self.chatChannelController = chatChannelController
self.viewFactory = viewFactory
}

public var body: some View {
ChatChannelView(
viewFactory: DefaultViewFactory.shared,
viewFactory: viewFactory,
channelController: chatChannelController
)
}
Expand Down

0 comments on commit e5b0be1

Please sign in to comment.