From e5b0be1ed3c5fe4bb1f63b950ee58cb9ca5acbcf Mon Sep 17 00:00:00 2001 From: Toomas Vahter Date: Fri, 11 Oct 2024 10:42:09 +0300 Subject: [PATCH] Make ChatChannelScreen init public (#618) --- .../ChatChannel/ChatChannelScreen.swift | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) 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 ) }