Need help to figure out how to customize the UI to meet our UI requirements. While we were able to figure out on Android, iOS code on SendBird UIKit seems a bit complex to comprehend. Screens that we need to customize-
We need to remove the “Leave channel” button from the setting screen attached below.
we need to remove this “Edit” button from the top as we are not allowing users to update channel Name or Channel profile picture.
Need to remove “+” button as we are not allowing anyone to add members to the channel.
On iOS, you can customize it through the process of initializing the ViewController or by overriding it by inheritance.
You can rebuild the UITableViewDataSource, UITableViewDelegate to implement only the features you want.
or If you only want to quickly remove the Leave feature, please inherit SBUChannelSettingsViewController and implement the following part.
Set rightButton in the process of initializing SBUChannelSettingsViewController by inheriting SBUChannelViewController on your own ChannelViewController and overriding the functions below.
open func showChannelSettings() {
let channelSettingsVC = SBUChannelSettingsViewController(channel: self.channel)
channelSettingsVC.rightBarButton = nil
self.navigationController?.pushViewController(channelSettingsVC, animated: true)
Set rightButton in the process of initializing SBUMemberListViewController by inheriting SBUChannelSettingsViewController on your own ChannelSettingsViewController and overriding the functions below.
open func showMemberList() {
guard let channel = self.channel else { return }
let memberListVC = SBUMemberListViewController(channel: channel)
memberListVC..rightBarButton = nil
self.navigationController?.pushViewController(memberListVC, animated: true)
}
I’m sorry for the difficulty in using it. However, thank you for the tip-off.
We continue to try to make customization easier.
Ah! And if there is a new issue, please report it to UIKit topics so that you can see it with others. UIKit topic
Hi @Tez . I followed your instructions as I need to customize in the same way to remove “edit” & “add member” capabilities. This what I did. Thx much for the original question and reply!
//
// Overriding a couple of SBD View Controller classes is needed
// to be able to hide the "edit" and "add member" capabilities.
// https://community.sendbird.com/t/sendbirduikit-ios-help/699/2
//
class INQChannelViewController : SBUChannelViewController {
override open func showChannelSettings() {
class INQChannelSettingsViewController : SBUChannelSettingsViewController {
override open func showMemberList() {
class INQMemberListViewController : SBUMemberListViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.rightBarButton = nil // Needed to remove Add Member capability from SBD Members List View
}
}
guard let channel = self.channel else { return }
let memberListVC = INQMemberListViewController(channel: channel)
self.navigationController?.pushViewController(memberListVC, animated: true)
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.rightBarButton = nil // Needed to remove Edit capability from SBD Channel Settings View
}
}
let channelSettingsVC = INQChannelSettingsViewController(channel: super.channel!)
self.navigationController?.pushViewController(channelSettingsVC, animated: true)
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
//self.rightBarButton = nil // Needed to remove Settings capability from SBD Channel View
}
}
let channelVC = INQChannelViewController(channel: channel)
let naviVC = UINavigationController(rootViewController: channelVC)
self.present(naviVC, animated: true)