swiftswiftuigetstream-io

how to customize getstream chat swiftui view


I am using the getstream chat swiftuI library.

But customizing swiftUI View is difficult.

For example, I want to hide part of the view as shown in the photo.

enter image description here

This is the code to go from ChatChannelVC to ChatChannelInfoView.

@objc func didSelectAvatarView() {
        guard let channel = self.channelController.channel else { return }
        
        let channelInfoView = ChatChannelInfoView(channel: channel)
        let vc = UIHostingController.init(rootView: channelInfoView)
        navigationController?.pushViewController(vc, animated: true)
}

ChatChannelVC is implemented in UIKit and ChatChannelInfoView is implemented in SwiftUI.

Because there is no ChatChannelInfoView in the StreamChat UIKit library.

ChatChannelInfoView belongs to the StreamChatSwiftUI library and cannot be directly modified.


Solution

  • As far as I understand, you're using our UIKit SDK, but you need the channel info view from SwiftUI.

    This view is provided as is, but we can make some of our views hidden with a configuration. Please create an issue on our GH repo for this: https://github.com/GetStream/stream-chat-swiftui.

    Best, Martin