CreateConversation
enables users to:
UIPageViewController
.MessagesVC
upon selecting a user or group.CometChat.login()
before presenting this screen.UINavigationController
embedded in your flow.MessagesVC
implemented to handle chat screens.Component | Role |
---|---|
UISegmentedControl | Switches between “Users” and “Groups” tabs. |
UIPageViewController | Enables swipe navigation between list views. |
CometChatUsers | Displays the list of CometChat users. |
CometChatGroups | Displays the list of CometChat groups. |
MessagesVC | Chat interface, launched upon item selection. |
searchController | Provides search for both users and groups. |
CometChatTheme | Applies theming (colors, fonts) for UI consistency. |
CometChatTypography | Defines text styles for segment labels. |
CreateConversations
to allow starting a chat.
HomeScreenViewController.swift
Provides entry point to the create-conversation flow.
CreateConversations.swift
Initializes the UI elements and search integration.
CreateConversations.swift
Keeps the proper search bar and view in sync with the selected tab.
MessagesVC
when a user or group is tapped.
CreateConversations.swift
Routes the user to the appropriate chat screen.
CreateConversations.swift
Synchronizes the segmented control with page swipes.
CometChatTheme
to customize tint and font.searchController.placeholder
and styling.CometChatUsers
and CometChatGroups
.setErrorView()
on list components.onItemClick
to prevent navigation.Feature | Implementation |
---|---|
Show create screen | showCreateConversation() |
Tabbed lists | UISegmentedControl + UIPageViewController |
Display users | CometChatUsers() |
Display groups | CometChatGroups() |
Search functionality | searchController |
Navigate to chat | MessagesVC(user:) / MessagesVC(group:) |
CreateConversationVC
:
GitHub → CreateConversationVC.swift