> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-docs-uikit-customization-architecture.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# UI Components

> UI Components — CometChat documentation.

**UI Components** are building blocks of the UI Kit. **UI Components** are a set of custom classes specially designed to build a rich chat app. There are different UI Components available in the UI Kit Library.

## 1. CometChatUI

**CometChatUI** is an option to launch a fully functional chat application using the UI Kit. In **CometChatUI** all the **UI Components** are interlinked and work together to launch a fully functional chat on your mobile application.

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-uikit-customization-architecture/XlCM57sxYRHPI24X/images/e44cdb6f-1623200179-937cd0e375e1300a22cb40f677f69912.jpg?fit=max&auto=format&n=XlCM57sxYRHPI24X&q=85&s=fbb4a8199f7c0e7e363b56acd6133e38" width="7774" height="4184" data-path="images/e44cdb6f-1623200179-937cd0e375e1300a22cb40f677f69912.jpg" />
</Frame>

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    DispatchQueue.main.async {
    let cometChatUI = CometChatUI()
    cometChatUI.setup(withStyle: .fullScreen)
    self.present(cometChatUI, animated: true, completion: nil)
    }
    ```
  </Tab>
</Tabs>

## 2. CometChatConversationList

The **CometChatConversationList** is a view controller with a list of recent conversations. The view controller has all the necessary delegates and methods.

You can present this screen using **two methods.**

### Launch Conversation List (Recommended)

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    let conversationList = CometChatConversationList()
    let navigationController = UINavigationController(rootViewController:conversationList)
    conversationList.set(title:"Chats", mode: .automatic)
    self.present(navigationController, animated:true, completion:nil)
    ```
  </Tab>
</Tabs>

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-uikit-customization-architecture/kCBz3Y8kc8Vkl_76/images/91d893d8-484464a-conversationList-a021a1ca1a7b6b6c15c2eb4650e22839.jpg?fit=max&auto=format&n=kCBz3Y8kc8Vkl_76&q=85&s=eeb827180474f6826beae573d8bbeff1" width="1709" height="3424" data-path="images/91d893d8-484464a-conversationList-a021a1ca1a7b6b6c15c2eb4650e22839.jpg" />
</Frame>

### Embed Conversation List in View Controller

You can use this by subclassing UIViewController as **CometChatConversationList** as shown below:

<Note>
  > To assign a CometChatConversationList to view controller make sure that the Navigation controller is attached properly.
</Note>

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    import CometChatPro

    class viewController: CometChatConversationList {

    override func viewDidLoad() {
          super.viewDidLoad()
          self.delegate = self
    	}
    }
    ```
  </Tab>
</Tabs>

Also, you can perform an action on tap on the conversation by adding **ConversationListDelegate** in the app's view controller as shown below:

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    extension viewController: ConversationListDelegate {
        
    func didSelectConversationAtIndexPath(conversation: Conversation, indexPath: IndexPath){
            //Do Stuff
        }  
    }
    ```
  </Tab>
</Tabs>

## 3. CometChatCallsList

The **CometChatCallsList** is a view controller with a list of recent calls. The view controller has all the necessary delegates and methods.

You can present this screen using **two methods.**

### Launch Calls List (Recommended)

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    let callList = CometChatCallsList()
    let navigationController = UINavigationController(rootViewController:callList)
    callList.set(title:"Calls", mode: .automatic)
    self.present(navigationController, animated:true, completion:nil)
    ```
  </Tab>
</Tabs>

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-uikit-customization-architecture/hDyd1GHptjwTOB4H/images/9f658703-d93c58c-CallsList-83bf53d90de9a928a129951a51b2bef4.jpg?fit=max&auto=format&n=hDyd1GHptjwTOB4H&q=85&s=fda7c8b321acd9684d2299c2b041d7c9" width="2014" height="4032" data-path="images/9f658703-d93c58c-CallsList-83bf53d90de9a928a129951a51b2bef4.jpg" />
</Frame>

### Embed Call List in View Controller

You can use this by subclassing UIViewController as **CometChatCallsList** as shown below:

<Note>
  > To assign a CometChatCallsList to view controller make sure that the Navigation controller is attached properly.
</Note>

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    import CometChatPro

    class viewController: CometChatCallsList {

    override func viewDidLoad() {
          super.viewDidLoad()
          self.delegate = self
    	}
    }
    ```
  </Tab>
</Tabs>

Also, you can perform an action on tap on the call by adding **CallsListDelegate** in the app's view controller as shown below:

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    extension viewController: CallsListDelegate {
        
    func didSelectCallsAtIndexPath(call: BaseMessage, indexPath: IndexPath){
            //Do Stuff
        }  
    }
    ```
  </Tab>
</Tabs>

## 4. CometChatUserList

The **CometChatUserList** is a view controller with a list of users. The view controller has all the necessary delegates and methods.

You can present this screen using **two methods.**

### Launch User List (Recommended)

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    let userList = CometChatUserList()
    let navigationController = UINavigationController(rootViewController:userList)
    userList.set(title:"Contacts", mode: .automatic)
    self.present(navigationController, animated:true, completion:nil)
    ```
  </Tab>
</Tabs>

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-uikit-customization-architecture/HTBnar4dYlG-Fm2S/images/6869fc65-bdb8d7d-userList-6e3c0da50fe84c4cb845d8e8cee7befb.jpg?fit=max&auto=format&n=HTBnar4dYlG-Fm2S&q=85&s=6e57ab0b0c105bb9138d32ca2dbd6f93" width="1709" height="3424" data-path="images/6869fc65-bdb8d7d-userList-6e3c0da50fe84c4cb845d8e8cee7befb.jpg" />
</Frame>

### Embed User List in View Controller

You can use this by subclassing UIViewController as **CometChatUserList** as shown below:

<Note>
  > To assign a CometChatUserList to view controller make sure that the Navigation controller is attached properly.
</Note>

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    import CometChatPro

    class viewController: CometChatUserList {

    override func viewDidLoad() {
      super.viewDidLoad()
      self.delegate = self
      }
    }
    ```
  </Tab>
</Tabs>

Also, you can perform an action on tap on the user by adding **UserListDelegate** in the app's view controller as shown below:

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    extension viewController: UserListDelegate {
        
    func didSelectUserAtIndexPath(user: User, indexPath: IndexPath) {
            //Do Stuff
        }  
    }
    ```
  </Tab>
</Tabs>

## 5. CometChatGroupList

The **CometChatGroupList** is a view controller with a list of groups. The view controller has all the necessary delegates and methods.

You can present this screen using **two methods.**

### Launch Group List (Recommended)

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    let groupList = CometChatGroupList()
    let navigationController = UINavigationController(rootViewController:groupList)
    groupList.set(title:"Groups", mode: .automatic)
    self.present(navigationController, animated:true, completion:nil)
    ```
  </Tab>
</Tabs>

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-uikit-customization-architecture/XmT5lvz52y07CtOd/images/ba586e31-5b5e37a-groupList-e9f9e6ae9bc50ddf5861cf939d038a51.jpg?fit=max&auto=format&n=XmT5lvz52y07CtOd&q=85&s=6860a63460e6333f6f775c410c22081a" width="1709" height="3424" data-path="images/ba586e31-5b5e37a-groupList-e9f9e6ae9bc50ddf5861cf939d038a51.jpg" />
</Frame>

### Embed Group List in View Controller

You can use this by subclassing UIViewController as **CometChatGroupList** as shown below:

<Note>
  > To assign a CometChatGroupList to view controller make sure that the Navigation controller is attached properly.
</Note>

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    import CometChatPro

    class viewController: CometChatGroupList {

    override func viewDidLoad() {
          super.viewDidLoad()
          self.delegate = self
    	}
    }
    ```
  </Tab>
</Tabs>

Also, you can perform an action on tap on the group by adding **GroupListDelegate** in the app's view controller as shown below:

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    extension viewController: GroupListDelegate {
        
    func didSelectGroupAtIndexPath(group: Group, indexPath: IndexPath)
            //Do Stuff
        }  
    }
    ```
  </Tab>
</Tabs>

## 6. CometChatMessageList

The **CometChatMessageList** is a view controller with a list of messages for a particular user or group. The view controller has all the necessary delegates and methods.

**CometChatMessageList** requires `User` or `Group` object to work properly.

<Note>
  > To retrieve the User or Group object you can call CometChat.getUser() or CometChat.getGroup().
</Note>

You can present this screen using **two methods.**

### Launch Message List (Recommended)

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    let messageList = CometChatMessageList()
    let navigationController = UINavigationController(rootViewController:messageList)
    messageList.set(conversationWith: user, type: .user)
    self.present(navigationController, animated:true, completion:nil)
    ```
  </Tab>
</Tabs>

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-uikit-customization-architecture/gc6smRtLfR-dbpSa/images/052d2ab7-c4cd46d-messageList-8d97521f157b35614374a9d03ff59452.jpg?fit=max&auto=format&n=gc6smRtLfR-dbpSa&q=85&s=f556cc5e425a21ab477ff825ded8b765" width="3988" height="7985" data-path="images/052d2ab7-c4cd46d-messageList-8d97521f157b35614374a9d03ff59452.jpg" />
</Frame>

### Embed Message List in View Controller

You can use this by subclassing UIViewController as **CometChatMessageList** as shown below:

<Note>
  > To assign a CometChatMessageList to view controller make sure that the Navigation controller is attached properly.
</Note>

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    import CometChatPro

    class viewController: CometChatMessageList {

    override func viewDidLoad() {
          super.viewDidLoad()
          set(conversationWith: user, type: .user)
    	}
    }
    ```
  </Tab>
</Tabs>

## 7. CometChatUserProfile

The **CometChatUserProfile** is a view controller with user information and a list of dummy cells for settings of the app which the developer can use in his app.

You can present this screen using **two methods.**

### Launch User Profile (Recommended)

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    let userProfile = CometChatUserProfile()
    let navigationController = UINavigationController(rootViewController:userProfile)
    userProfile.set(title:"More", mode: .automatic)
    self.present(navigationController, animated:true, completion:nil)
    ```
  </Tab>
</Tabs>

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-uikit-customization-architecture/kCBz3Y8kc8Vkl_76/images/94eb6b13-feba996-moreInfo-3e8959fa08b73f40daac81689c83e7dd.jpg?fit=max&auto=format&n=kCBz3Y8kc8Vkl_76&q=85&s=23ae5163ba557f2ae35c9a5da7fa2ee3" width="1709" height="3424" data-path="images/94eb6b13-feba996-moreInfo-3e8959fa08b73f40daac81689c83e7dd.jpg" />
</Frame>

### Embed UserProfile inView Controller

You can use this by subclassing UIViewController as **CometChatUserProfile** as shown below:

<Note>
  > To assign a CometChatUserProfile to view controller make sure that the Navigation controller is attached properly.
</Note>

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    import CometChatPro

    class viewController: CometChatUserProfile {

    override func viewDidLoad() {
          super.viewDidLoad()
    		 
    	}
    }
    ```
  </Tab>
</Tabs>
