-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I refresh an existing Stream view when the Stream user changes #3425
Comments
Hi @srgray, You will need to create a new controller and use Thank you, |
@nuno-vieira That works great, thank you. Does |
@srgray You don't need to recreate the view, you only need to recreate the controller and refresh the data 👍 |
@nuno-vieira Can you take a look at this modified sample project? I'm recreating the controller for ChatChannelVC, but I don't know how to refresh the data: Steps:
|
Hi @srgray, When you set the new controller than you need to call synchornize. Something like this: channelController.delegate = self
channelController.synchronize { [weak self] error in
self?.didFinishSynchronizing(with: error)
} |
@nuno-vieira thank you, that works! |
What did you do?
I switched Stream users while a Stream view (
ChatChannelListVC
) was visible (and didn't recreate it).What did you expect to happen?
I expected Stream to refresh
ChatChannelListVC
with the new data after the other user was logged in.What happened instead?
ChatChannelListVC
shows empty data after disconnect/connect sequence.GetStream Environment
GetStream Chat version: 4.63.0
GetStream Chat frameworks: StreamChat, StreamChatUI
iOS version: 18.0
Swift version: 5
Xcode version: 16
Device: iPhone 16 Pro simulator
Additional context
See attached sample project:
StreamSwitchUsers 2.zip
Steps to reproduce:
How can I tell
ChatChannelListVC
to refresh after a new user is connected? I know that I can change my app navigation to recreate theChatChannelListVC
after the new user is connected, but I would like to know if I can avoid that. This goes for other Stream views likeChatChannelVC
, too.The text was updated successfully, but these errors were encountered: