Customize UI Kit
This guide helps you to customize, modify, and enable/disable features present in UIKit.
note
CometChat SDK & UI Kit both need to be configured before starting the customization in UI Kit.
To Modify and customize UI Kit, you need to refer to the UIKitSettings
class present in the UI Kit Library.
You will be easily able to modify the color, enable/disable some of the features which you won't require in your app.
important
- UI Kit Settings must be called before launching any UI Screen or UI Unified. By default, all settings will be enabled.> - For advanced level customization, you can modify the source code of the library as per your requirement.
1. Color Settings
Sr No | Description | Code Snippet | Settings |
---|---|---|---|
1. | Modify primary colour | UIKitSettings.primaryColor = UIColor.lightBlue | Requires Object of UIColor class |
2. Tab bar settings
Sr No | Description | Code Snippet | Settings |
---|---|---|---|
1. | Hide/Show recents chats tab | UIKitSettings.conversations = .enabled | You can show it using .enabled or hide it using .disabled . |
2. | Hide/Show calls tab | UIKitSettings.calls = .enabled | You can show it using .enabled or hide it using .disabled . |
3. | Hide/Show users tab | UIKitSettings.users = .enabled | You can show it using .enabled or hide it using .disabled . |
4. | Hide/Show groups tab | UIKitSettings.groups = .enabled | You can show it using .enabled or hide it using .disabled . |
5. | Hide/Show user information tab | UIKitSettings.userSettings = .enabled | You can show it using .enabled or hide it using .disabled . |
6. | Shuffle or re-arrange tabs | UIKitSettings.tabs = [.chats, .calls, .users , .groups, .settings] | You can re-arrange, remove or add tabs using this. This method takes the array of Controller which has following parameters. 1. Chats: Show recent chats 2. Calls: Show calls 3. Users: Show users 4. Groups: Show groups 5. Settings: Show user information tab |
7. | Show real time connection indicator | UIKitSettings.connectionIndicator = .enabled | You can show it using .enabled or hide it using .disabled . |
3. Recent chats settings
Sr No | Description | Code Snippet | Settings | |
---|---|---|---|---|
1. | Show unread count | UIKitSettings.unreadCount = .enabled | You can show it using .enabled or hide it using .disabled . | |
2. | Show search bar in chats | UIKitSettings.searchChats = .enabled | You can show it using .enabled or hide it using .disabled . | |
3. | Show all users/groups or both | UIKitSettings.chatListMode = .both | You can show all users using .user or show groups using .group or show both of them using .both . |
4. Call settings
Sr No | Description | Code Snippet | Settings |
---|---|---|---|
1. | Enable audio call for user | UIKitSettings.userAudioCall = .enabled | You can show it using .enabled or hide it using .disabled . |
2. | Enable audio call for group | UIKitSettings.groupAudioCall = .enabled | You can show it using .enabled or hide it using .disabled . |
3. | Enable video call for user | UIKitSettings.userVideoCall = .enabled | You can show it using .enabled or hide it using .disabled . |
4. | Enable video call for group | UIKitSettings.groupVideoCall = .enabled | You can show it using .enabled or hide it using .disabled . |
5. | Enable sound for calls | UIKitSettings.enableSoundForCalls = .enabled | You can show it using .enabled or hide it using .disabled . |
6. | Show action messages for calls. | UIKitSettings.enableActionsForCalls = .enabled | You can show it using .enabled or hide it using .disabled . |
5. User settings
Sr No | Description | Code Snippet | Settings |
---|---|---|---|
1. | Show all users/friends | UIKitSettings.userInMode = .all | You can show all users using .all or show friends using .friends . |
2. | Show user presence | UIKitSettings.showUserPresence = .enabled | You can show it using .enabled or hide it using .disabled . |
3. | Show block user | UIKitSettings.blockUser = .enabled | You can show it using .enabled or hide it using .disabled . |
4. | Show search user | UIKitSettings.searchUsers = .enabled | You can show it using .enabled or hide it using .disabled . |
5. | Show view profile | UIKitSettings.viewProfile = .enabled | You can show it using .enabled or hide it using .disabled . |
6. Group settings
Sr No | Description | Code Snippet | Settings |
---|---|---|---|
1. | Show create group | UIKitSettings.groupCreation = .enabled | You can show it using .enabled or hide it using .disabled . |
2. | Show join or leave group | UIKitSettings.joinOrLeaveGroup = .enabled | You can show it using .enabled or hide it using .disabled . |
3. | Show delete group | UIKitSettings.allowDeleteGroup = .enabled | You can show it using .enabled or hide it using .disabled . |
4. | Show group members | UIKitSettings.viewGroupMembers = .enabled | You can show it using .enabled or hide it using .disabled . |
5. | Show add member | UIKitSettings.allowAddMembers = .enabled | You can show it using .enabled or hide it using .disabled . |
6. | Allow moderator to delete messages of participants | UIKitSettings.allowModeratorToDeleteMemberMessages = .enabled | You can show it using .enabled or hide it using .disabled . |
7. | Allow user to kick members | UIKitSettings.kickMember = .enabled | You can show it using .enabled or hide it using .disabled . |
8. | Allow user to ban members | UIKitSettings.banMember = .enabled | You can show it using .enabled or hide it using .disabled . |
9. | Allow user to promote or demote members | UIKitSettings.allowPromoteDemoteMembers = .enabled | You can show it using .enabled or hide it using .disabled . |
10. | Show action messages for groups. | UIKitSettings.enableActionsForGroupNotifications = .enabled | You can show it using .enabled or hide it using .disabled . |
11. | Show public group option for creating groups. | UIKitSettings.publicGroup = .enabled | You can show it using .enabled or hide it using .disabled . |
12. | Show private group option for creating groups. | UIKitSettings.privateGroup = .enabled | You can show it using .enabled or hide it using .disabled . |
13. | Show password protected group option for creating groups. | UIKitSettings.passwordGroup = .enabled | You can show it using .enabled or hide it using .disabled . |
14. | Show search groups | UIKitSettings.searchGroups = .enabled | You can show it using .enabled or hide it using .disabled . |
15. | Enable message in private from Groups | UIKitSettings.messageInPrivate = .enabled | You can show it using .enabled or hide it using .disabled . |
16. | Enable message receipt information from Groups | UIKitSettings.messageInformation = .enabled | You can show it using .enabled or hide it using .disabled . |
7. Message settings
Sr No | Description | Code Snippet | Settings |
---|---|---|---|
1. | Show message composer for one-on-one chat | UIKitSettings.sendMessageInOneOnOne = .enabled | You can show it using .enabled or hide it using .disabled . |
2. | Show message composer for group chat | UIKitSettings.sendMessageInGroup = .enabled | You can show it using .enabled or hide it using .disabled . |
3 | Show send text message | UIKitSettings.sendTextMessage = .enabled | You can show it using .enabled or hide it using .disabled . |
4. | Show send photos & videos | UIKitSettings.sendPhotoVideos = .enabled | You can show it using .enabled or hide it using .disabled . |
5. | Show send files & documents | UIKitSettings.sendFiles = .enabled | You can show it using .enabled or hide it using .disabled . |
6. | Show send voice notes | UIKitSettings.sendVoiceNotes = .enabled | You can show it using .enabled or hide it using .disabled . |
7. | Show send emojis from keyboard | UIKitSettings.sendEmojis = .enabled | You can show it using .enabled or hide it using .disabled . |
8. | Show send emojis in Larger Size | UIKitSettings.sendEmojisInLargerSize = .enabled | You can show it using .enabled or hide it using .disabled . |
9. | Show send stickers | UIKitSettings.sendStickers = .enabled | You can show it using .enabled or hide it using .disabled . |
10. | Send typing indicator | UIKitSettings.sendTypingIndicator = .enabled | You can show it using .enabled or hide it using .disabled . |
11. | Send message reaction | UIKitSettings.sendMessageReaction = .enabled | You can show it using .enabled or hide it using .disabled . |
12. | Send live reaction | UIKitSettings.sendLiveReaction = .enabled | You can show it using .enabled or hide it using .disabled . |
13.. | Ability to edit the message | UIKitSettings.editMessage = .enabled | You can show it using .enabled or hide it using .disabled . |
14. | Ability to delete the message | UIKitSettings.deleteMessage = .enabled | You can show it using .enabled or hide it using .disabled . |
15. | Ability to share, copy & forward the message | UIKitSettings.shareCopyForwardMessage = .enabled | You can show it using .enabled or hide it using .disabled . |
16. | Ability to reply on message | UIKitSettings.replyToMessage = .enabled | You can show it using .enabled or hide it using .disabled . |
17. | Ability to start new thread for message | UIKitSettings.threadedChats = .enabled | You can show it using .enabled or hide it using .disabled . |
18. | Ability to share live reaction | UIKitSettings.shareLiveReaction = .enabled | You can show it using .enabled or hide it using .disabled . |
19. | Ability to share your location | UIKitSettings.shareLocation = .enabled | You can show it using .enabled or hide it using .disabled . |
20. | Show shared media | UIKitSettings.viewShareMedia = .enabled | You can show it using .enabled or hide it using .disabled . |
21. | Show read/delivery receipts for Messages | UIKitSettings.showReadDeliveryReceipts = .enabled | You can show it using .enabled or hide it using .disabled . |
22. | Ability to create poll (Poll Extension must be enabled from Dashboard) | UIKitSettings.polls = .enabled | You can show it using .enabled or hide it using .disabled . |
23. | Enable sound for Messages | UIKitSettings.enableSoundForMessages = .enabled | You can show it using .enabled or hide it using .disabled . |
24. | Enable Message Reactions | UIKitSettings.messageReaction = .enabled | You can show it using .enabled or hide it using .disabled . |
20. | Enable Collaborative Document | UIKitSettings.collaborativeDocument = .enabled | You can show it using .enabled or hide it using .disabled . |
25. | Enable Collaborative Whiteboard | UIKitSettings.collaborativeWhiteboard = .enabled | You can show it using .enabled or hide it using .disabled . |
22. | Enable Message Translation | UIKitSettings.messageTranslation = .enabled | You can show it using .enabled or hide it using .disabled . |
26. | Hide/show delete messages | UIKitSettings.hideDeletedMessages = .enabled | You can show it using .enabled or hide it using .disabled . |
27. | Enable Message History | UIKitSettings.messageHistory = .enabled | You can show it using .enabled or hide it using .disabled . |
28. | Show smart replies (Smart Replies Extension must be enabled from Dashboard) | UIKitSettings.smartReplies = .enabled | You can show it using .enabled or hide it using .disabled . |