GetStream / stream-chat-swift

💬 iOS Chat SDK in Swift - Build your own app chat experience for iOS using the official Stream Chat API
https://getstream.io/chat/sdk/ios/
Other
854 stars 207 forks source link

Support presenting the chat modally using UISheetPresentationController #2277

Closed pbendersky closed 2 years ago

pbendersky commented 2 years ago

What are you trying to achieve?

Present the chat UI without modally without covering the entire screen (we are presenting it over a playing video).

If possible, how can you achieve this currently?

We can't. As a workaround, we are presenting it as a modal that covers the entire screen.

What would be the better way?

We'd like to present the modal using UISheetPresentationController with detents, so it doesn't cover the playing video.

GetStream Environment

GetStream Chat version: 4.20.0 GetStream Chat frameworks: StreamChat, StreamChatUI iOS version: iOS 15 and up

Additional context

This is related to #1307 where you added support for presenting the chat modally.

nuno-vieira commented 2 years ago

Hi @pbendersky!

You can override ChatChannelListRouter.showChannel()and use a UISheetPresentationController. But as #1307 mentions, it might not work very well because we use an inverted table view. So if that doesn't work, it requires creating a custom transition to mimic the behaviour you want. For now, we don't have anything planned to support this out-of-the-box.

Best, Nuno

pbendersky commented 2 years ago

@nuno-vieira thank you for your answer. Do you know if the SwiftUI implementation uses the same technique to invert the scrolling? If not, we may try that route.

nuno-vieira commented 2 years ago

Hi @pbendersky,

The SwiftUI SDK is also using an inverted list.

nuno-vieira commented 2 years ago

@pbendersky, for now, it looks the only way to replicate this is to do a custom presentation. I'm going to convert this one as a discussion, and we will let you know once we have a plan to make this out of the box.

Best, Nuno