Chat UIKit iOS v3
Chat UIKit iOS
Chat UIKit
iOS
Version 3

From v3.5 to v3.6

Copy link

UIKit v3.6 for iOS has introduced major changes to SBUModuleSet. Refer to the following breaking changes and customization changes.


Breaking changes

Copy link

The following changes have been made to the public interfaces in SBUModuleSet.

  • Deprecated all public interfaces in SBUModuleSet and every module component such as headerComponent in v3.5.
  • Added new public interfaces in SBUModuleSet and every module component. Each public interface is now a metatype property.

SBUModuleSet customization changes

Copy link

Starting in UIKit v3.6 for iOS, all module instances are assigned to the type instead of value of the corresponding SBUModuleSet interface. Refer to the group channel module example below in the code snippet.

// SBUModuleSet
public static var GroupChannelModule: SBUGroupChannelModule.Type

As shown in the code snippet below, you need to assign the module instance to the SBUModuleSet interface type when customizing it.

// In v3.5
SBUModuleSet.groupChannelModule = MyAppChannelModule()
// In v3.6
SBUModuleSet.GroupChannelModule = MyAppChannelModule.self

Note: If you've been previously customizing modules by assigning custom module instances to SBUModuleSet, you need to be aware that starting in v3.6, the new interface doesn't reflect any customizations made to internal properties of the module instances.

Refer to the group channel module example in the code snippet below to learn how to create a new module instance with the SBUModuleSet interface type first, then apply customizations to the instance's internal properties.

// In v3.5
let myAppChannelModule = MyAppChannelModule()
myAppChannelModule.headerComponent = MyAppChannelModuleHeader()
SBUModuleSet.groupChannelModule = myAppChannelModule
// In v3.6
SBUModuleSet.GroupChannelModule = MyAppChannelModule.self
SBUModuleSet.GroupChannelModule.HeaderComponent = MyAppChannelModuleHeader.self

Module component customization changes

Copy link

All module components in UIKit v3.6 for iOS are assigned to the type instead of value of the corresponding SBUModuleSet interface. Refer to the group channel module example below in the code snippet.

// SBUGroupChannelModule example
public static var HeaderComponent: SBUGroupChannelModule.Header.Type
public static var ListComponent: SBUGroupChannelModule.List.Type
public static var InputComponent: SBUGroupChannelModule.List.Type

As shown in the code snippet below, you need to assign the module component instance to the SBUModuleSet interface type when customizing it.

// In v3.5
SBUModuleSet.groupChannelModule.headerComponent = MyAppChannelHeader()
SBUModuleSet.groupChannelModule.headerComponent = MyAppChannelList()
SBUModuleSet.groupChannelModule.headerComponent = MyAppChannelInput()
// In v3.6
SBUModuleSet.GroupChannelModule.HeaderComponent = MyAppChannelHeader.self
SBUModuleSet.GroupChannelModule.ListComponent = MyAppChannelList.self
SBUModuleSet.GroupChannelModule.InputComponent = MyAppChannelInput.self

Note: If you've been previously customizing module components by assigning custom component instances to SBUModuleSet, you need to be aware that starting in v3.6, the new interface doesn't reflect any customizations made to internal properties of the module instances.

Refer to the group channel module example in the code snippets below to learn how to create a new module component instance with the SBUModuleSet interface type first, then apply customizations to the instance's internal properties.

Customize module component in view controller

Copy link

You can customize the module component by setting the custom component in the corresponding view controller.

// In v3.5
let myHeaderComponent = MyAppChannelModuleHeader()
myHeaderComponent.rightBarButton = MyRightBarButton()
myHeaderComponent.rightBarButton.isHidden = false
SBUModuleSet.groupChannelModule.headerComponent = myHeaderComponent

// In v3.6
class MyAppChannelViewController: SBUGroupChannelViewController {
    override func init(channel: GroupChannel, messageListParams: MessageListParams? = nil) {
        super.init(channel: channel, messageListParams: messageListParams)
        self.headerComponent?.rightBarButton = MyRightBarButton()
        self.headerComponent?.rightBarButton.isHidden = false
    }
}
SBUModuleSet.GroupChannelModule.HeaderComponent = MyAppChannelModuleHeader.self
SBUViewControllerSet.GroupChannelViewController = MyAppChannelViewController.self

Note: If you update the custom module component after loadView() has been called, invoke the configure method of the module component. To learn more, see Sendbird UIKit life cycle.

Customize module component in module

Copy link

You can customize the module component by setting the custom component in the corresponding module.

// In v3.5
let myHeaderComponent = MyAppChannelModuleHeader()
myHeaderComponent.rightBarButton = MyRightBarButton()
myHeaderComponent.rightBarButton.isHidden = false
SBUModuleSet.groupChannelModule.headerComponent = myHeaderComponent

// In v3.6
class MyAppChannelModuleHeader: SBUGroupChannelModule.Header {
    override func configure(delegate: SBUGroupChannelModuleHeaderDelegate, theme: SBUChannelTheme)() {
        self.rightBarButton = MyRightBarButton()
        self.rightBarButton.isHidden = false
        
        super.configure(delegate: delegate, theme: theme)
    }
}
SBUModuleSet.GroupChannelModule.HeaderComponent = MyAppChannelModuleHeader.self

Note: You need to set up the view components first before calling super.configure(delegate:theme:). To learn more, see Component life cycle.

Public interface name changes

Copy link

The following tables show the name changes of interfaces in each key function.

List channels

Copy link
ClassTypeFrom v3.5To v3.6

SBUModuleSet

SBUGroupChannelListModule

groupChannelListModule

GroupChannelListModule

SBUModuleSet

SBUOpenChannelListModule

openChannelListModule

OpenChannelListModule

SBUGroupChannelListModule

SBUGroupChannelListModule.Header

headerComponent

HeaderComponent

SBUGroupChannelListModule

SBUGroupChannelListModule.List

listComponent

ListComponent

SBUOpenChannelListModule

SBUOpenChannelListModule.Header

headerComponent

HeaderComponent

SBUOpenChannelListModule

SBUOpenChannelListModule.List

listComponent

ListComponent

Chat in a channel

Copy link
ClassTypeFrom v3.5To v3.6

SBUModuleSet

SBUBaseChannelModule

baseChannelModule

BaseChannelModule

SBUModuleSet

SBUGroupChannelModule

groupChannelModule

GroupChannelModule

SBUModuleSet

SBUOpenChannelModule

openChannelModule

OpenChannelModule

SBUModuleSet

SBUFeedNotificationChannelModule

feedNotificationChannelModule

FeedNotificationChannelModule

SBUModuleSet

SBUChatNotificationChannelModule

chatNotificationChannelModule

ChatNotificationChannelModule

SBUBaseChannelModule

SBUBaseChannelModule.Header

headerComponent

HeaderComponent

SBUBaseChannelModule

SBUBaseChannelModule.List

listComponent

ListComponent

SBUBaseChannelModule

SBUBaseChannelModule.Input

inputComponent

InputComponent

SBUGroupChannelModule

SBUGroupChannelModule.Header

headerComponent

HeaderComponent

SBUGroupChannelModule

SBUGroupChannelModule.List

listComponent

ListComponent

SBUGroupChannelModule

SBUGroupChannelModule.Input

inputComponent

InputComponent

SBUOpenChannelModule

SBUOpenChannelModule.Header

headerComponent

HeaderComponent

SBUOpenChannelModule

SBUOpenChannelModule.List

listComponent

ListComponent

SBUOpenChannelModule

SBUOpenChannelModule.Input

inputComponent

InputComponent

SBUOpenChannelModule

SBUOpenChannelModule.Media

mediaComponent

MediaComponent

SBUFeedNotificationChannelModule

SBUFeedNotificationChannelModule.Header

headerComponent

HeaderComponent

SBUFeedNotificationChannelModule

SBUFeedNotificationChannelModule.List

listComponent

ListComponent

SBUChatNotificationChannelModule

SBUChatNotificationChannelModule.Header

headerComponent

HeaderComponent

SBUChatNotificationChannelModule

SBUChatNotificationChannelModule.List

listComponent

ListComponent

Create a channel

Copy link
ClassTypeFrom v3.5To v3.6

SBUModuleSet

SBUCreateChannelModule

createGroupChannelModule

CreateChannelModule

SBUModuleSet

SBUCreateOpenChannelModule

createOpenChannelModule

CreateOpenChannelModule

SBUCreateChannelModule

SBUCreateChannelModule.Header

headerComponent

HeaderComponent

SBUCreateChannelModule

SBUCreateChannelModule.List

listComponent

ListComponent

SBUCreateOpenChannelModule

SBUCreateOpenChannelModule.Header

headerComponent

HeaderComponent

SBUCreateOpenChannelModule

SBUCreateOpenChannelModule.ProfileInput

profileInputComponent

ProfileInputComponent

Register as operator

Copy link
ClassTypeFrom v3.5To v3.6

SBUModuleSet

SBURegisterOperatorModule

groupRegisterOperatorModule

GroupRegisterOperatorModule

SBUModuleSet

SBURegisterOperatorModule

openRegisterOperatorModule

OpenRegisterOperatorModule

SBURegisterOperatorModule

SBURegisterOperatorModule.Header

headerComponent

HeaderComponent

SBURegisterOperatorModule

SBURegisterOperatorModule.List

listComponent

ListComponent

List users

Copy link
ClassTypeFrom v3.5To v3.6

SBUModuleSet

SBUUserListModule

groupUserListModule

GroupUserListModule

SBUModuleSet

SBUUserListModule

openUserListModule

OpenUserListModule

SBUUserListModule

SBUUserListModule.Header

headerComponent

HeaderComponent

SBUUserListModule

SBUUserListModule.List

listComponent

ListComponent

Configure channel settings

Copy link
ClassTypeFrom v3.5To v3.6

SBUModuleSet

SBUGroupChannelPushSettingsModule

groupChannelPushSettingsModule

GroupChannelPushSettingsModule

SBUModuleSet

SBUGroupChannelSettingsModule

groupChannelSettingsModule

GroupChannelSettingsModule

SBUModuleSet

SBUOpenChannelSettingsModule

openChannelSettingsModule

OpenChannelSettingsModule

SBUGroupChannelPushSettingsModule

SBUGroupChannelPushSettingsModule.Header

headerComponent

HeaderComponent

SBUGroupChannelPushSettingsModule

SBUGroupChannelPushSettingsModule.List

listComponent

ListComponent

SBUGroupChannelSettingsModule

SBUGroupChannelSettingsModule.Header

headerComponent

HeaderComponent

SBUGroupChannelSettingsModule

SBUGroupChannelSettingsModule.List

listComponent

ListComponent

SBUOpenChannelSettingsModule

SBUOpenChannelSettingsModule.Header

headerComponent

HeaderComponent

SBUOpenChannelSettingsModule

SBUOpenChannelSettingsModule.List

listComponent

ListComponent

Invite users

Copy link
ClassTypeFrom v3.5To v3.6

SBUModuleSet

SBUInviteUserModule

inviteUserModule

InviteUserModule

SBUInviteUserModule

SBUInviteUserModule.Header

headerComponent

HeaderComponent

SBUInviteUserModule

SBUInviteUserModule.List

listComponent

ListComponent

Moderate channels and users

Copy link
ClassTypeFrom v3.5To v3.6

SBUModuleSet

SBUModerationsModule

groupModerationsModule

GroupModerationsModule

SBUModuleSet

SBUModerationsModule

openModerationsModule

OpenModerationsModule

SBUModerationsModule

SBUModerationsModule.Header

headerComponent

HeaderComponent

SBUModerationsModule

SBUModerationsModule.List

listComponent

ListComponent

Search messages

Copy link
ClassTypeFrom v3.5To v3.6

SBUModuleSet

SBUMessageSearchModule

messageSearchModule

MessageSearchModule

SBUMessageSearchModule

SBUMessageSearchModule.Header

headerComponent

HeaderComponent

SBUMessageSearchModule

SBUMessageSearchModule.List

listComponent

ListComponent

Reply to messages

Copy link
ClassTypeFrom v3.5To v3.6

SBUModuleSet

SBUMessageThreadModule

messageThreadModule

MessageThreadModule

SBUMessageThreadModule

SBUMessageThreadModule.Header

headerComponent

HeaderComponent

SBUMessageThreadModule

SBUMessageThreadModule.List

listComponent

ListComponent

SBUMessageThreadModule

SBUMessageThreadModule.Input

inputComponent

InputComponent