diff --git a/Sources/StreamChatSwiftUI/ChatChannel/ChatChannelScreen.swift b/Sources/StreamChatSwiftUI/ChatChannel/ChatChannelScreen.swift index 0a4355b4..fc9d4371 100644 --- a/Sources/StreamChatSwiftUI/ChatChannel/ChatChannelScreen.swift +++ b/Sources/StreamChatSwiftUI/ChatChannel/ChatChannelScreen.swift @@ -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: 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 ) }