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
To customize SBUGroupChannelListModule.List, inherit from this class to create a CustomGroupChannelModule.List class.
The CustomGroupChannelModule.List class is configured to put a CustomChannelListHeaderView in the listComponent.
classCustomGroupChannelModule{classList:SBUGroupChannelListModule.List{// You can create a CustomView based on a UIView like this and use it.public lazy varcustomHeaderView=CustomChannelListHeaderView()overridefunc setupViews(){
super.setupViews()// Creates the `customHeaderView`self.addSubview(self.customHeaderView)}overridefunc setupLayouts(){
super.setupLayouts()// Sets the `customHeaderView` layoutself.customHeaderView
.sbu_constraint(equalTo:self, leading:0, trailing:0, top:0).sbu_constraint(height:50)// Deactivates the existing topConstraint of the tableView.
if let tableViewTopConstraint =self.constraints.first(where:{
$0.firstAttribute ==.top && $0.firstItem ===self.tableView
}){
tableViewTopConstraint.isActive = false
}// Set the tableView's topConstraint to customHeaderViewself.tableView.sbu_constraint_equalTo(
topAnchor:self.customHeaderView.bottomAnchor,
top:0)}}}
Before using a customized viewController class, please set it in the SBUModuleSet.
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
The logic below is a custom snippet with a simple example.
Create a
CustomChannelListHeaderView
class that inherits fromUIView
.SBUViewLifeCycle
is used for the view life cycle used by SendbirdUIKit. It is not required, so you can configure your view without it if you want.SBUGroupChannelListModule.List
, inherit from this class to create aCustomGroupChannelModule.List
class.CustomGroupChannelModule.List
class is configured to put aCustomChannelListHeaderView
in the listComponent.SBUModuleSet
.Result
Reference
Beta Was this translation helpful? Give feedback.
All reactions