Skip to content

Commit e5b0be1

Browse files
authored
Make ChatChannelScreen init public (#618)
1 parent 2d3487f commit e5b0be1

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

Sources/StreamChatSwiftUI/ChatChannel/ChatChannelScreen.swift

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,21 @@ import StreamChat
66
import SwiftUI
77

88
/// Screen component for the chat channel view.
9-
public struct ChatChannelScreen: View {
10-
public var chatChannelController: ChatChannelController
9+
public struct ChatChannelScreen<Factory>: View where Factory: ViewFactory {
10+
public let chatChannelController: ChatChannelController
11+
private let viewFactory: Factory
1112

13+
public init(
14+
chatChannelController: ChatChannelController,
15+
viewFactory: Factory = DefaultViewFactory.shared
16+
) {
17+
self.chatChannelController = chatChannelController
18+
self.viewFactory = viewFactory
19+
}
20+
1221
public var body: some View {
1322
ChatChannelView(
14-
viewFactory: DefaultViewFactory.shared,
23+
viewFactory: viewFactory,
1524
channelController: chatChannelController
1625
)
1726
}

0 commit comments

Comments
 (0)