From v2 to v3
UIKit v3 for iOS is now available. UIKit v3 has a dependency on Chat SDK v4. Before migrating from v2 to v3, refer to the migration guide of Chat SDK v4 for iOS for any breaking changes. The Chat SDK must be updated first before proceeding with the latest version of UIKit.
The biggest change from v2 to v3 is modularization, which allows you to build and customize views at a component level. You can execute key functions of UIKit using a view controller, which is composed of a module and a view model. In each key function, the module is used to create and display everything UI-related while the view model is in charge of managing data from Chat SDK to apply to each view. This new architecture allows for easier and more detailed customization.
When migrating from v2 to v3, there are several breaking changes you need to remember. Since modules and view models are one of the main parts of the new architecture, you need to make changes to the existing codes in your client app. Refer to the breaking changes below in each key function.
Modules (Deprecated)
In every key function provided by Sendbird UIKit, there's a module, which is composed of several components, in each view controller. These components, also referred to as module components, make up the view in the corresponding key function to create and display an interactive UI. Unlike v2 where the view controller handled all UI-related features, the modules and components now manage the UI of each view controller in v3. These modules and components are customizable to fit your own design needs.
Note: The
SBUModuleSetin UIKit v3.0 for iOS has been deprecated starting in v3.5. Refer to the new migration guide from UIKit v3.5 to v3.6.
All modules are owned and managed by the SBUModuleSet global class. If you don't want to use the default module and component provided by UIKit, you can set a custom module and component in the SBUModuleSet so the customized objects become the default settings throughout the entire client app.
All components use a delegate to send events that occur in the view to the view controller and a data source object to receive necessary data from the view controller. Refer to the table below to learn about the relationship between key function, module, component, and view controller.
Module relationship table
| Key function | Module | Component | View controller |
|---|---|---|---|
SBUGroupChannelListModule | Header, List | SBUGroupChannelListViewController | |
SBUGroupChannelModule | Header, List, Input | SBUGroupChannelViewController | |
SBUOpenChannelModule | Header, List, Input, Media | SBUOpenChannelViewController | |
SBUCreateChannelModule | Header, List | SBUCreateChannelViewController | |
SBUInviteUserModule | Header, List | SBUInviteUserViewController | |
SBURegisterOperatorModule | Header, List | SBURegisterOperatorViewController | |
SBURegisterOperatorModule | Header, List | SBURegisterOperatorViewController | |
SBUUserListModule | Header, List | SBUUserListViewController | |
SBUUserListModule | Header, List | SBUUserListViewController | |
SBUGroupChannelSettingsModule | Header, List | SBUGroupChannelSettingsViewController | |
SBUOpenChannelSettingsModule | Header, List | SBUOpenChannelSettingsViewController | |
SBUModerationsModule | Header, List | SBUModerationsViewController | |
SBUModerationsModule | Header, List | SBUModerationsViewController | |
SBUMessageSearchModule | Header, List | SBUMessageSearchViewController |
View model
In a key function, each view controller has a corresponding view model, which processes and requests data directly from Sendbird Chat SDK. Without needing to call the Chat SDK interface, the view controller can simply use a view model to manage and process data needed to build a view in UIKit. Every view model has a delegate that is used to send data updates in the form of events to the view controller. It also uses a data source object to gather necessary data from the view controller.
Refer to the table below to learn about the relationship between key function, view model, and view controller.
View model relationship table
| Key function | View model | View controller |
|---|---|---|
List channels | SBUGroupChannelListViewModel | SBUGroupChannelListViewController |
Chat in a group channel | SBUGroupChannelViewModel | SBUGroupChannelViewController |
Chat in an open channel | SBUOpenChannelViewModel | SBUOpenChannelViewController |
Create a group channel | SBUCreateChannelViewModel | SBUCreateChannelViewController |
Invite users | SBUInviteUserViewModel | SBUInviteUserViewController |
Register users as operator | SBURegisterOperatorViewModel | SBURegisterOperatorViewController |
List channel members or participants | SBUUserListViewModel | SBUUserListViewController |
Configure group channel settings | SBUGroupChannelSettingsViewModel | SBUGroupChannelSettingsViewController |
Configure open channel settings | SBUOpenChannelSettingsViewModel | SBUOpenChannelSettingsViewController |
Moderate channels and users | SBUModerationsViewModel | SBUModerationsViewController |
Search messages | SBUMessageSearchViewModel | SBUMessageSearchViewController |
Added SBUViewControllerSet and SBUModuleSet
Starting in v3 of UIKit for iOS, SBUViewControllerSet and SBUModuleSet have been added to minimize inheriting and overriding when customizing views. In v3, you can now set a custom view controller and module in SBUViewControllerSet and SBUModuleSet respectively, in order to make changes to the view.
SBUViewControllerSet
In Sendbird UIKit, there is a SBUViewControllerSet global class that manages the view controllers of all key functions. SBUViewControllerSet is a property that's composed of class types of all the view controller classes.
If you don't want to use the default view controller provided by the UIKit, you can set a custom view controller within SBUViewControllerSet. By implementing a view controller that's been customized in the global class, you can use it across the entire client app without having to change it each time. Refer to the example code below:
You can also still use the existing customization method in v2 where you directly implement your own custom view controller.
When creating a custom view controller instance, Sendbird UIKit follows the order of usage below:
- A view controller that's been customized upon initial setting.
- A view controller that's been customized within
SBUViewControllerSet. - A non-customized, default view controller provided by Sendbird UIKit.
If you didn't set your own custom view controller, then a view controller that's been customized within SBUViewControllerSet is used instead throughout the UIKit. If there are no custom view controllers, the default view controller provided by Sendbird UIKit in SBUViewControllerSet is used.
SBUModuleSet
In Sendbird UIKit, there is a SBUModuleSet global class that manages all modules and each module is composed of various components. The global SBUModuleSet provides the corresponding module and its components to each view controller.
If you don't want to use the default module and component provided by the UIKit, you can set a custom module and component in SBUModuleSet so the customized objects become the default setting throughout the entire UIKit without having to change them each time. Refer to the example codes below:
Set a custom module
Set a custom component
When using a customized module or its component, the view controller follows the order below:
- A module or component that's been customized in the view controller.
- A custom module or component that's been customized in
SBUModuleSet. - A non-customized, default module and component provided by Sendbird UIKit.
If you didn't set a custom module or component in the view controller, then a custom module or component that's been set in SBUModuleSet is used instead throughout the UIKit. If there are no custom modules or components, the default objects provided by Sendbird UIKit in SBUModuleSet are used.
Breaking changes
See the breaking changes below in each key function.
Note : You'll be notified of changes in the code through warning and error messages in the build phase of Xcode.
SendbirdUIKit initialization
The following tables show the changes made to the initialization functions in UIKit v3. When initializing Sendbird UIKit, we recommend displaying a loading indicator to show the initialization progress and indicate that other succeeding steps should wait. The indicator should be displayed when startHandler is called and hidden when completionHandler is called. Refer to initialize(applicationId:startHandler:migrationHandler:completionHandler:) in SendbirdUI.
UIKit SDK name
| From v2 | To v3 |
|---|---|
SendBirdUIKit | SendbirdUIKit |
UIKit main class name
| From v2 | To v3 |
|---|---|
SBUMain | SendbirdUI |
Function name
| From v2 | To v3 |
|---|---|
initialize(applicationId:migrationStartHandler:completionHandler:) | initialize(applicationId:startHandler:migrationHandler:completionHandler:) |
Enumerate
Enumerate name in SBUEnums
| From v2 | To v3 |
|---|---|
ChannelMemberListType | ChannelUserListType |
Enumerate case names in SBUEnums
| From v2 | To v3 | Enum |
|---|---|---|
channelMembers | members | ChannelUserListType |
mutedMembers | muted | ChannelUserListType |
bannedMembers | banned | ChannelUserListType |
bannedMembers | bannedUsers | ModerationItemType |
channelMembers | members | UserListType |
inviteUser | invite | UserListType |
mutedMembers | muted | UserListType |
bannedMembers | banned | UserListType |
noBannedMembers | noBannedUsers | EmptyViewType |
Strings
The following tables show what changes were made in SBUStringSet from v2 to v3.
Added new strings
The following objects have been added to SBUStringSet in v3:
UserList_Title_Muted_ParticipantsEmpty_No_Muted_Participants
StringSet names
| From v2 | To v3 |
|---|---|
ChannelSettings_Banned_Members | ChannelSettings_Banned_Users |
Empty_No_Banned_Members | Empty_No_Banned_Users |
InviteChannel_Header_Select_Members | InviteChannel_Header_Select_Users |
MemberList_Me | UserList_Me |
MemberList_Ban | UserList_Ban |
MemberList_Unban | UserList_Unban |
MemberList_Mute | UserList_Mute |
MemberList_Unmute | UserList_Unmute |
MemberList_Dismiss_Operator | UserList_Unregister_Operator |
MemberList_Promote_Operator | UserList_Register_Operator |
MemberList_Title_Members | UserList_Title_Members |
MemberList_Title_Operators | UserList_Title_Operators |
MemberList_Title_Muted_Members | UserList_Title_Muted_Members |
MemberList_Title_Banned_Members | UserList_Title_Banned_Users |
MemberList_Title_Participants | UserList_Title_Participants |
UserProfile_Promote | UserProfile_Register |
UserProfile_Dismiss | UserProfile_Unregister |
Removed a string from StringSet
MemberList_Header_Title
All key functions
The following tables show what changes were made from v2 to v3.
Method and event delegate names in all view controllers
| From v2 | To v3 |
|---|---|
setupAutolayout() | setupLayouts() |
updateAutolayout() | updateLayouts() |
didReceiveError(::) | errorHandler(::) |
shouldShowLoadingIndicator() | shouldUpdateLoadingState(_:) |
Property names in SBUGlobals
| From v2 | To v3 |
|---|---|
ApplicationId | applicationId |
AccessToken | accessToken |
CurrentUser | currentUser |
UsingMessageGrouping | isMessageGroupingEnabled |
ReplyTypeToUse | replyType |
UsingPHPicker | isPHPickerEnabled |
UsingUserProfile | isUserProfileEnabled |
UsingUserProfileInOpenChannel | isOpenChannelUserProfileEnabled |
UsingImageCompression | isImageCompressionEnabled |
List channels
The following tables show what changes were made in SBUChannelListViewController from v2 to v3.
View controller name
| From v2 | To v3 |
|---|---|
SBUChannelListViewController | SBUGroupChannelListViewController |
Added new components and view model
The following objects have been added to SBUGroupChannelListViewController in v3:
headerComponentlistComponentviewModel
To learn more, go to the Usage section of the view controller page.
Moved view properties to component
| From v2 | To v3 | Component |
|---|---|---|
titleView | headerComponent.titleView | Header |
leftBarButton | headerComponent.leftBarButton | Header |
rightBarButton | headerComponent.rightBarButton | Header |
emptyView | listComponent.emptyView | List |
tableView | listComponent.tableView | List |
channelCell | listComponent.channelCell | List |
customCell | listComponent.customCell | List |
Moved properties to view model
| From v2 | To v3 |
|---|---|
channelListQuery | viewModel.channelListQuery |
includeEmptyChannel | viewModel.channelListQuery.includeEmptyChannel |
Moved property to view model and changed name
| From v2 | To v3 |
|---|---|
limit | viewModel.channelListQuery.limit |
Deprecated properties
Due to the addition of local caching, the following properties have been deprecated in v3:
isLoadinglastUpdatedTimestamplastUpdatedToken
Moved methods to component
| Method | Component |
|---|---|
register(channelCell:nib:) | List |
register(customCell:nib:) | List |
reloadTableView() | List |
didSelectRetry() | List |
Moved methods to view model
The following methods have been moved to the view model in v3:
loadNextChannelList(reset:)sortChannelList(needReload:)updateChannels(_:needReload:)upsertChannels(_:needReload:)deleteChannels(channelURLs:needReload:)changePushTriggerOption(option:channel:completionHandler:)leaveChannel(_:completionHandler:)
Moved method to view model and changed name
| From v2 | To v3 |
|---|---|
resetChannelList() | viewModel.reset() |
Method name
| From v2 | To v3 |
|---|---|
setLoading(::) | showLoading(_:) |
Deprecated methods
Due to the addition of local caching, the following methods have been deprecated in v3:
channel(_:userDidJoin user:)channel(_:userDidLeave user:)channelWasChanged(_:)channel(_:messageWasDeleted:)channelWasFrozen(_:)channelWasUnfrozen(_:)channel(_:userWasBanned:)didSucceedReconnection()
Chat in a channel
The following tables show what changes were made in SBUBaseChannelViewController from v2 to v3.
Added new components and view model
The following objects have been added to SBUBaseChannelViewController in v3:
baseHeaderComponentbaseListComponentbaseInputComponentbaseViewModel
Depending on the channel type, the base components and base view model become channel-specific. The appropriate components and view model are then used in each SBUGroupChannelViewController and SBUOpenChannelViewController.
Moved view properties to component
| From v2 | To v3 | Component |
|---|---|---|
messageInputView | inputComponent.messageInputView | Input |
userProfileView | listComponent.userProfileView | List |
tableView | listComponent.tableView | List |
emptyView | listComponent.emptyView | List |
Moved properties to view model
| From v2 | To v3 |
|---|---|
channelUrl | viewModel.channelURL |
inEditingMessage | viewModel.inEditingMessage |
messageListParams | viewModel.messageListParams |
messageList | viewModel.messageList |
fullMessageList | viewModel.fullMessageList |
Moved methods to component
| Method | Component |
|---|---|
setScrollBottomView(hidden:) | List |
didSelectMessage(userId:) | List |
didSelectClose() | List |
didSelectRetry() | List |
Moved methods to component and changed names
| From v2 | To v3 | Component |
|---|---|---|
sendImageFileMessage(info:) | pickImageFile(info:) | Input |
sendVideoFileMessage(info:) | pickVideoFile(info:) | Input |
sendDocumentFileMessage(documentUrls:) | pickDocumentFile(documentURLs:) | Input |
Moved methods to component's delegate and changed names
| From v2 | To v3 | Component |
|---|---|---|
scrollToBottom(animated:) | baseChannelModuleDidTapScrollToButton(_:animated:) | List |
setUserProfileTapGestureHandler(_:) | baseChannelModule(_:didTapUserProfile:) | List |
messageInputView(_:didSelectSend:) | baseChannelModule(_:didTapSend:parentMessage:) | Input |
messageInputView(_:didSelectResource:) | baseChannelModule(_:didTapResource:) | Input |
messageInputView(_:didSelectEdit:) | baseChannelModule(_:didTapEdit:) | Input |
messageInputView(_:didChangeText:) | baseChannelModule(_:didChangeText:) | Input |
messageInputView(_:willChangeMode:message:) | baseChannelModule(_:willChangeMode:message:) | Input |
messageInputView(_:didChangeMode:message:) | baseChannelModule(_:didChangeMode:) | Input |
messageInputViewDidStartTyping() | baseChannelModuleDidStartTyping(_:) | Input |
messageInputViewDidEndTyping() | baseChannelModuleDidEndTyping(_:) | Input |
Moved methods to view model
The following methods have been moved to the view model in v3:
loadChannel(channelURL:messageListParams:)clearMessageList()upsertMessagesInList(messages:needUpdateNewMessage:needReload:)deleteMessagesInList(messageIds:excludeResendableMessages:needReload:)deleteResendableMessage(_:needReload:)deleteResendableMessages(requestIds:needReload:)sortAllMessageList(needReload:)updateUserMessage(message:text:)updateUserMessage(message:messageParams:)resendMessage(failedMessage:)sendUserMessage(text:)sendUserMessage(text:parentMessage:)sendUserMessage(messageParams:parentMessage:)sendFileMessage(fileData:fileName:mimeType:)sendFileMessage(fileData:fileName:mimeType:parentMessage:)sendFileMessage(messageParams:parentMessage:)
Moved method to view model and changed name
| From v2 | To v3 |
|---|---|
deleteMessagesInList(messageIds:needReload:) | deleteMessagesInList(messageIds:excludeResendableMessages:needReload:) |
Method names
| From v2 | To v3 |
|---|---|
deleteMessage(message:) | listComponent.showDeleteMessageAlert(message:) |
setLoading(::) | showLoading(_:) |
Chat in a group channel
The following tables show what changes were made in SBUChannelViewController from v2 to v3.
View controller name
| From v2 | To v3 |
|---|---|
SBUChannelViewController | SBUGroupChannelViewController |
Added new components and view model
The following objects have been added to SBUGroupChannelViewController in v3:
headerComponentlistComponentinputComponentviewModel
To learn more, go to the Usage section of the view controller page.
Moved view properties to component
| From v2 | To v3 | Component |
|---|---|---|
titleView | headerComponent.titleView | Header |
leftBarButton | headerComponent.leftBarButton | Header |
rightBarButton | headerComponent.rightBarButton | Header |
newMessageInfoView | listComponent.newMessageInfoView | List |
channelStateBanner | listComponent.channelStateBanner | List |
scrollBottomView | listComponent.scrollBottomView | List |
adminMessageCell | listComponent.adminMessageCell | List |
userMessageCell | listComponent.userMessageCell | List |
fileMessageCell | listComponent.fileMessageCell | List |
customMessageCell | listComponent.customMessageCell | List |
unknownMessageCell | listComponent.unknownMessageCell | List |
Moved methods to component
| Method | Component |
|---|---|
register(userMessageCell:nib:) | List |
register(fileMessageCell:nib:) | List |
register(adminMessageCell:nib:) | List |
register(customMessageCell:nib:) | List |
getMessageGroupingPosition(currentIndex:) | List |
setScrollBottomView(hidden:) | List |
generateCellIdentifier(by:) | List |
updateMessageInputModeState() | Input |
Moved methods to component and changed names
| From v2 | To v3 | Component |
|---|---|---|
checkSameDayAsNextMessage(currentIndex:) | checkSameDayAsNextMessage(currentIndex:fullMessageList:) | List |
setUserMessageCellGestures(:userMessage:indexPath:) | setMessageCellGestures(_:message:indexPath:) | List |
Moved methods to component's delegate and changed names
| From v2 | To v3 | Component |
|---|---|---|
onClickScrollBottom(sender:) | baseChannelModuleDidTapScrollToButton(_:animated:) | List |
setTapGestureHandler(_:message:) | baseChannelModule(_:didTapMessage:forRowAt:) | List |
setLongTapGestureHandler(_:message:indexPath:) | baseChannelModule(_:didLongTapMessage:forRowAt:) | List |
setEmojiTapGestureHandler(_:emojiKey:) | groupChannelModule(_:didTapEmoji:messageCell:) | List |
setEmojiLongTapGestureHandler(_:emojiKey:) | groupChannelModule(_:didLongTapEmoji:messageCell:) | List |
messageInputViewDidEndTyping() | baseChannelModuleDidEndTyping(_:) | Input |
Moved methods to view model
The following methods have been moved to the view model in v3:
channel(_:didReceive:)channel(_:didUpdate:)channel(_:messageWasDeleted:)didSucceedReconnection()
Moved methods to view model's delegate and changed names
| From v2 | To v3 |
|---|---|
channelWasChanged(:) | baseChannelViewModel(_:didChangeChannel:withContext:) |
Method names
| From v2 | To v3 |
|---|---|
onClickSetting() | showChannelSettings() |
setLoading(::) | showLoading(_:) |
Chat in an open channel
The following tables show what changes were made in SBUOpenChannelViewController from v2 to v3.
Added new components and view model
The following objects have been added to SBUOpenChannelViewController in v3:
headerComponentlistComponentinputComponentmediaComponentviewModel
To learn more, go to the Usage section of the view controller page.
Moved view properties to component
| From v2 | To v3 | Component |
|---|---|---|
titleView | headerComponent.titleView | Header |
leftBarButton | headerComponent.leftBarButton | Header |
rightBarButton | headerComponent.rightBarButton | Header |
channelInfoView | listComponent.channelInfoView | Header |
mediaView | mediaComponent.mediaView | Media |
newMessageInfoView | listComponent.newMessageInfoView | List |
channelStateBanner | listComponent.channelStateBanner | List |
adminMessageCell | listComponent.adminMessageCell | List |
userMessageCell | listComponent.userMessageCell | List |
fileMessageCell | listComponent.fileMessageCell | List |
customMessageCell | listComponent.customMessageCell | List |
unknownMessageCell | listComponent.unknownMessageCell | List |
Moved methods to component
| Method | Component |
|---|---|
register(userMessageCell:nib:) | List |
register(fileMessageCell:nib:) | List |
register(adminMessageCell:nib:) | List |
register(customMessageCell:nib:) | List |
updateMessageInputModeState() | List |
getMessageGroupingPosition(currentIndex:) | List |
setScrollBottomView(hidden:) | List |
generateCellIdentifier(by:) | List |
Moved methods to component and changed names
| From v2 | To v3 | Component |
|---|---|---|
checkSameDayAsNextMessage(currentIndex:) | checkSameDayAsNextMessage(currentIndex:fullMessageList:) | List |
setUserMessageCellGestures(:userMessage:indexPath:) | setMessageCellGestures(_:message:indexPath:) | List |
onClickParticipantsList() | didSelectChannelParticipants() | Header |
Moved methods to component's delegate and changed names
| From v2 | To v3 | Component |
|---|---|---|
onClickScrollBottom(sender:) | baseChannelModuleDidTapScrollToButton(_:animated:) | List |
setTapGestureHandler(_:message:) | baseChannelModule(_:didTapMessage:forRowAt:) | List |
setLongTapGestureHandler(_:message:indexPath:) | baseChannelModule(_:didLongTapMessage:forRowAt:) | List |
didSelectChannelInfo() | baseChannelModule(_:didTapRightItem:) | Header |
Moved methods to view model
The following methods have been moved to the view model in v3:
loadChannel(channelURL:messageListParams:)updateMessagesInList(messages:needReload:)channel(_:didUpdate:)channel(_:messageWasDeleted:)didSucceedReconnection()
Moved methods to view model's delegate and changed names
| From v2 | To v3 |
|---|---|
channelWasChanged(:) | baseChannelViewModel(_:didChangeChannel:withContext:) |
Method names
| From v2 | To v3 |
|---|---|
deleteMessage(message:) | listComponent.showDeleteMessageMenu(on:oneTimeTheme) |
onClickSetting() | showChannelSettings() |
onClickParticipantsList() | showParticipantsList() |
setLoading(::) | showLoading(_:) |
Create a group channel
The following tables show what changes were made in SBUCreateChannelViewController from v2 to v3.
Added new components and view model
The following objects have been added to SBUCreateChannelViewController in v3:
headerComponentlistComponentviewModel
To learn more, go to the Usage section of the view controller page.
Moved view properties to component
| From v2 | To v3 | Component |
|---|---|---|
titleView | headerComponent.titleView | Header |
leftBarButton | headerComponent.leftBarButton | Header |
rightBarButton | headerComponent.rightBarButton | Header |
emptyView | listComponent.emptyView | List |
tableView | listComponent.tableView | List |
userCell | listComponent.userCell | List |
Moved property to view model
| From v2 | To v3 |
|---|---|
userListQuery | viewModel.userListQuery |
Moved methods to component
| Method | Component |
|---|---|
register(userCell:nib:) | List |
didSelectRetry() | List |
Moved methods to component and changed names
| From v2 | To v3 | Component |
|---|---|---|
reloadData() | listComponent.reloadTableView() | List |
Moved methods to view model
The following methods have been moved to the view model in v3:
loadNextUserList(reset:users:)createChannel(userIds:)createChannel(params:messageListParams:)selectUser(user:)
Moved method to view model's data source and changed name
| From v2 | To v3 |
|---|---|
nextUserList() | createChannelViewModel(_:nextUserListForChannelType:) |
Method names
| From v2 | To v3 |
|---|---|
showLoading(state:) | showLoading(_:) |
onClickCreate() | createChannelWithSelectedUsers() |
Invite users or register users as operator
In v3, the SBUInviteUserViewController class has separated into SBUInviteUserViewController and SBURegisterOperatorViewController and SBUBaseSelectUserViewController was added to include shared properties and methods between the two features. The following tables show what changes were made in SBUInviteUserViewController from v2 to v3.
Added new components and view model
The following objects have been added to SBUInviteUserViewController and SBURegisterOperatorViewController in v3:
headerComponentlistComponentviewModel
To learn more, go to the Usage section for group channel or open channel under Key functions.
Divided SBUInviteUserViewController class
| Invite users | Register as operator |
|---|---|
SBUInviteUserViewController | SBURegisterOperatorViewController |
Removed types in initializers
After the view controller class got separated into two view controllers, the type parameter has been removed from the initializers.
| From v2 | To v3 |
|---|---|
init(channel:type:) | init(channel:) |
init(channel:users:type:) | init(channel:users:) |
init(channelUrl:type:) | init(channelURL:) |
init(channelUrl:users:type:) | init(channelURL:users:) |
Moved view properties to component
| From v2 | To v3 | Component |
|---|---|---|
titleView | headerComponent.titleView | Header |
leftBarButton | headerComponent.leftBarButton | Header |
rightBarButton | headerComponent.rightBarButton | Header |
tableView | listComponent.tableView | List |
userCell | listComponent.userCell | List |
Moved properties to view model
| From v2 | To v3 |
|---|---|
inviteListType | viewModel.inviteListType |
joinedUserIds | viewModel.joinedUserIds |
userListQuery | viewModel.userListQuery |
memberListQuery | viewModel.memberListQuery |
Moved method to component
| Method | Component |
|---|---|
register(userCell:nib:) | List |
Moved method to component and changed name
| From v2 | To v3 | Component |
|---|---|---|
reloadData() | listComponent.reloadTableView() | List |
Moved methods to view model
The following methods have been moved to the view model in v3:
loadChannel(channelURL:type:)loadNextUserList(reset:users:)inviteUsers()resetUserList()selectUser(user:)
Moved method to component and changed name
| From v2 | To v3 | Component |
|---|---|---|
|
|
|
Method names
| From v2 | To v3 | Class |
|---|---|---|
inviteUsers() | inviteSelectedUsers() | SBUInviteUserViewController |
promoteToOperators() | registerSelectedUsers() | SBURegisterOperatorViewController |
onClickInviteOrPromote() | inviteSelectedUsers() | SBUInviteUserViewController |
List channel members or participants
The following tables show what changes were made in SBUMemberListViewController from v2 to v3.
View controller name
| From v2 | To v3 |
|---|---|
SBUMemberListViewController | SBUUserListViewController |
Added new components and view model
The following objects have been added to SBUUserListViewController in v3:
headerComponentlistComponentviewModel
To learn more, go to the Usage section for group channel or open channel under Key functions.
Initializers
The type parameter name has been changed to userListType.
| From v2 | To v3 |
|---|---|
init(channel:type:) | init(channel:userListType:) |
init(channel:members:type:) | init(channel:users:userListType:) |
init(channelUrl:type:) | init(channelURL:channelType:userListType:) |
init(channelUrl:members:type:) | init(channelURL:channelType:users:userListType:) |
Moved view properties to component
| From v2 | To v3 | Component |
|---|---|---|
titleView | headerComponent.titleView | Header |
leftBarButton | headerComponent.leftBarButton | Header |
rightBarButton | headerComponent.rightBarButton | Header |
emptyView | listComponent.emptyView | List |
tableView | listComponent.tableView | List |
userCell | listComponent.userCell | List |
Moved list query properties to view model
| From v2 | To v3 |
|---|---|
memberListQuery | viewModel.memberListQuery |
operatorListQuery | viewModel.operatorListQuery |
mutedMemberListQuery | viewModel.mutedMemberListQuery |
bannedMemberListQuery | viewModel.bannedUserListQuery |
participantListQuery | viewModel.participantListQuery |
Moved methods to component
| Method | Component |
|---|---|
register(userCell:nib:) | List |
didSelectRetry() | List |
Moved methods to component and changed names
| From v2 | To v3 | Component |
|---|---|---|
reloadData() | reloadTableView() | List |
setMoreMenuActionHandler(_:) | setMoreMenuTapAction(_:) | List |
setUserProfileTapGestureHandler(_:) | setUserProfileTapAction(_:) | List |
Moved methods to view model
The following methods have been moved to the view model in v3:
channelDidUpdateOperators(_:)channel(_:userDidJoin:)channel(_:userDidLeave:)channel(_:userDidExit:)channel(_:userDidEnter:)
Moved methods to view model and change names
| From v2 | To v3 |
|---|---|
loadChannel(channelUrl:) | loadChannel(channelURL:type:) |
loadNextMemberList(reset:members:) | loadNextUserList(reset:users:) |
loadMembers() | loadNextUserList(reset:) |
preLoadNextMemberList(indexPath:) | preLoadNextUserList(indexPath) |
promoteToOperator(member:) | registerAsOperator(user:) |
dismissOperator(member:) | unregisterOperator(user:) |
mute(member:) | mute(user:) |
unmute(member:) | unmute(user:) |
ban(member:) | ban(user:) |
unban(member:) | unban(user:) |
resetMemberList(), reloadMemberList() | resetUserList() |
Moved methods to view model's data source and change names
| From v2 | To v3 |
|---|---|
nextMemberList() | userListViewModel(_:nextUserListForChannel:) |
Method name
| From v2 | To v3 |
|---|---|
onClickInviteUser() | showInviteUser() |
Configure channel settings
The following tables show what changes were made in SBUBaseChannelSettingViewController from v2 to v3.
View controller name
| From v2 | To v3 |
|---|---|
SBUBaseChannelSettingViewController | SBUBaseChannelSettingsViewController |
Added new components and view model
The following objects have been added to SBUBaseChannelSettingsViewController in v3:
headerComponentlistComponentviewModel
Moved view properties to component
| From v2 | To v3 | Component |
|---|---|---|
titleView | headerComponent.titleView | Header |
leftBarButton | headerComponent.leftBarButton | Header |
rightBarButton | headerComponent.rightBarButton | Header |
tableView | listComponent.tableView | List |
userInfoView | listComponent.channelInfoView | List |
Moved property to view model
| From v2 | To v3 |
|---|---|
isOperator | viewModel.isOperator |
Moved methods to view model
The following methods have been moved to the view model in v3:
loadChannel(channelURL:)updateChannel(channelName:coverImage:)channel(_:userDidEnter:)channel(_:userDidExit:)channel(_:userDidJoin:)channel(_:userDidLeave:)
Method name
| From v2 | To v3 |
|---|---|
onClickEdit() | showChannelEditActionSheet() |
Configure group channel settings
The following tables show what changes were made in SBUChannelSettingsViewController from v2 to v3.
View controller name
| From v2 | To v3 |
|---|---|
SBUChannelSettingsViewController | SBUGroupChannelSettingsViewController |
Added new components and view model
The following objects have been added to SBUGroupChannelSettingsViewController in v3:
headerComponentlistComponentviewModel
To learn more, go to the Usage section of the view controller page.
Moved methods to view model
The following methods have been moved to the view model in v3:
loadChannel(channelURL:)updateChannel(channelName:coverImage:)updateChannel(params:)leaveChannel()
Method names
| From v2 | To v3 |
|---|---|
onClickEdit() | showChannelEditActionSheet() |
updateChannelInfo(channelName:) | viewModel.updateChannel(channelName:coverImage:) |
Configure open channel settings
The following lists show what changes were made in SBUOpenChannelSettingsViewController from v2 to v3.
Added new components and view model
The following objects have been added to SBUOpenChannelSettingsViewController in v3:
headerComponentlistComponentviewModel
To learn more, go to the Usage section of the view controller page.
Moved methods to view model
The following methods have been moved to the view model in v3:
loadChannel(channelURL:)updateChannel(channelName:coverImage:)updateChannel(params:)deleteChannel()
Moderate channels and users
The following tables show what changes were made in SBUModerationsViewController from v2 to v3.
Added new components and view model
The following objects have been added to SBUModerationsViewController in v3:
headerComponentlistComponentviewModel
To learn more, go to the Usage section for group channel or open channel under Key functions.
Moved view properties to component
| From v2 | To v3 | Component |
|---|---|---|
titleView | headerComponent.titleView | Header |
leftBarButton | headerComponent.leftBarButton | Header |
rightBarButton | headerComponent.rightBarButton | Header |
tableView | listComponent.tableView | List |
Moved method to view model
The following method has been moved to the view model in v3:
loadChannel(channelURL:)
Moved methods to view model and changed names
| From v2 | To v3 |
|---|---|
freezeChannel(completionHandler:) | freezeChannel(_:) |
unfreezeChannel(completionHandler:) | unfreezeChannel(_:) |
Method names
| From v2 | To v3 |
|---|---|
showBannedMeberList() | showBannedUserList() |
Search messages
The following tables show what changes were made in SBUMessageSearchViewController from v2 to v3.
Added new components and view model
The following objects have been added to SBUMessageSearchViewController in v3:
headerComponentlistComponentviewModel
To learn more, go to the Usage section of the view controller page.
Moved view properties to component
| From v2 | To v3 | Component |
|---|---|---|
searchBar | headerComponent.titleView | Header |
emptyView | listComponent.emptyView | List |
tableView | listComponent.tableView | List |
messageSearchResultCell | listComponent.resultCell | List |
Moved properties to view model
| From v2 | To v3 |
|---|---|
channel | viewModel.channel |
messageListParams | viewModel.messageListParams |
Moved methods to component
| Method | Component |
|---|---|
updateSearchBarStyle(with:) | Header |
register(messageSearchResultCell:nib:) | List |
message(at:) | List |
| From v2 | To v3 | Component |
|---|---|---|
register(messageSearchResultCell:nib:) | register(resultCell:nib:) | List |
Moved method to view model
The following method has been moved to the view model in v3:
message(at:)