You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you need to change the order of the full list of messages in a channel or modify a particular message, you can edit the full list of messages used by the tableView by customizing the datasource before drawing it to the screen.
First, create a CustomChannelViewController class that inherits from SBUGroupChannelViewController.
Then override the baseChannelModule(_:fullMessagesInTableView:) method, customize the viewModel.fullMessageList inside the method, and return the customized fullMessageList.
classCustomChannelViewController:SBUGroupChannelViewController{overridefunc baseChannelModule(
_ listComponent:SBUBaseChannelModule.List,
fullMessagesInTableView tableView:UITableView)->[BaseMessage]{varfullMessageList= viewModel?.fullMessageList ??[]// Customize the fullMessageList// (e.g., change the sort, customize messages for certain conditions)return fullMessageList
}}
Before using a customized viewController class, please set it in the SBUViewControllerSet.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Summary
Guide & Snippet
CustomChannelViewController
class that inherits fromSBUGroupChannelViewController
.baseChannelModule(_:fullMessagesInTableView:)
method, customize theviewModel.fullMessageList
inside the method, and return the customizedfullMessageList
.SBUViewControllerSet
.Reference
Beta Was this translation helpful? Give feedback.
All reactions