> ## Documentation Index
> Fetch the complete documentation index at: https://www.cometchat.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Call Log Details

> One call's direction, date and duration, with its participants, recordings and the call history with that person or group.

`CometChatCallLogDetails` shows one call from the call log: a header for the other party with
call buttons, a card with the call's direction, date and duration, and three tabs —
**Participants**, **Recording** and **History** (every call with that user or group, paged).
You push it from [Call Logs](https://www.cometchat.com/docs/ui-kit/ios/v6/call-logs.md).

![CometChatCallLogDetails showing a call's summary and its participants](https://mintcdn.com/cometchat-22654f5b/pWDsskjSUHgot30F/images/ui-kit/ios/v6/docs-overview-call-log-details.png?fit=max\&auto=format\&n=pWDsskjSUHgot30F\&q=85\&s=9e3338cdb1c30131fb973760ef1a3f8c)

***

## Where It Fits

```
CometChatCallLogs ── onItemClick(log) ──▶ ┌───────────────────────────────────┐
                                           │ CometChatCallLogDetails ← here    │
                                           │  header · call buttons            │
                                           │  Incoming / Outgoing / Missed card│
                                           │  Participants │ Recording │ History│
                                           └───────────────────────────────────┘
```

***

## Quick Start

> [tab] SwiftUI
>
> Push it from the call log, inside your `NavigationStack`:
>
> ```swift theme={null}
> struct CallsTab: View {
>     @State private var opened: ChatCallLog?
>
>     var body: some View {
>         NavigationStack {
>             CometChatCallLogs(embedsNavigationStack: false, onItemClick: { opened = $0 })
>                 .navigationDestination(isPresented: Binding(get: { opened != nil },
>                                                             set: { if !$0 { opened = nil } })) {
>                     if let opened {
>                         CometChatCallLogDetails(callLog: opened, onError: { report($0) })
>                     }
>                 }
>         }
>     }
> }
> ```
>
> The back button is shown, and dismisses the screen. `onBack` replaces that.

> [tab] UIKit
>
> `CometChatCallLogDetails` is a `UIViewController`. Push it from the call log:
>
> ```swift theme={null}
> let calls = CometChatCallLogs()
>     .set(goToCallLogDetail: { callLog, _, _ in
>         let details = CometChatCallLogDetails(callLog: callLog)
>             .set(onError: { error in log(error) })
>         details.hidesBottomBarWhenPushed = true
>         navigationController?.pushViewController(details, animated: true)
>     })
> ```
>
> The title is "Call Detail". The back button is shown, and pops the screen — or dismisses it
> when it was presented. `set(onBack:)` replaces that.

***

## What It Shows

| Part | Content |
| - | - |
| header | the connected [message header](https://www.cometchat.com/docs/ui-kit/ios/v6/message-header.md) for the user or group, with its voice and video buttons and no status line. Until the user or group is fetched, it is drawn from the log's own name and avatar |
| info card | "Incoming", "Outgoing" or "Missed" with its icon, the call's date, and its duration — `42s` under a minute, `1:05 m` from a minute up |
| Participants | each participant's avatar and name, the call's date, and their time in the call |
| Recording | each recording's id and start date, with **Play** and **Download**; with none, "No Call Recordings" |
| History | every call with this user, or in this group, paged — direction, date and duration |

Participants and Recording come from the log itself. History is fetched when the screen
appears; its empty and error states are the call log's, with **Retry**.

> [tab] SwiftUI
>
> The tabs sit under the info card.

> [tab] UIKit
>
> Tap a tab or swipe between them. **Play** opens the recording in `AVPlayerViewController`;
> **Download** saves it to the app's Documents folder, then offers it in the share sheet.

***

## Actions and Events

### Callback Methods

> [tab] SwiftUI
>
> | Callback | Fires when | Default |
> | - | - | - |
> | `onBack` | the back button is tapped | dismiss |
> | `onVoiceCallClick`, `onVideoCallClick` | a header call button is tapped | the header starts the call |
> | `onPlayRecording` | **Play** is tapped | the recording plays in `AVPlayerViewController`, full screen |
> | `onDownloadRecording` | **Download** is tapped | the file is saved to the app's Documents folder, then offered in the share sheet |
> | `onError` | fetching the user or group fails, or a History page fails | — |
>
> ```swift theme={null}
> CometChatCallLogDetails(
>     callLog: sampleCallLog,
>     onPlayRecording: { recording in play(recording.url) },
>     onDownloadRecording: { recording in share(recording.url) }
> )
> ```

> [tab] UIKit
>
> | Callback | Fires when | Default |
> | - | - | - |
> | `set(onBack:)` | the back button is tapped | pop, or dismiss |
> | `set(onVoiceCallClick:)`, `set(onVideoCallClick:)` | a header call button is tapped | the header starts the call |
> | `set(onError:)` | fetching the user or group fails, a History page fails, or the header fails | — |
>
> ```swift theme={null}
> let details = CometChatCallLogDetails(callLog: sampleCallLog)
>     .set(onVoiceCallClick: { user, group in startMyCall(user: user, group: group, video: false) })
>     .set(onVideoCallClick: { user, group in startMyCall(user: user, group: group, video: true) })
> ```
>
> **Play** and **Download** have no callbacks; they always use the defaults above.

***

## Functionality

> [tab] SwiftUI
>
> | Parameter | Default | |
> | - | - | - |
> | `callLog` | required | the `ChatCallLog` to show |
> | `store` | `nil` | a `CallLogDetailsStore` |
> | `title` | "Call Detail" | the bar's title |
> | `hideToolbar` | `false` | the navigation bar |
> | `hideBackButton` | `false` | the back button |
> | `dateTimeFormatter` | none | the dates on the card and in the tabs |
> | `imageSource` | the shared cached loader | where avatars are loaded from |
> | `style` | `.init()` | a `CometChatCallLogDetailsStyle` |

> [tab] UIKit
>
> | Property | Default | |
> | - | - | - |
> | `hideBackButton` | `false` | the back button |
> | `hideNavigationBar` | `false` | the navigation bar |
> | `messageHeader` | — | the header itself; set any of its properties |
>
> The initialiser is `CometChatCallLogDetails(callLog:callLogDetailsStore:)`; the store is
> optional.

***

## Custom View Slots

> [tab] SwiftUI
>
> `headerView` replaces the message header:
>
> ```swift theme={null}
> CometChatCallLogDetails(callLog: sampleCallLog, headerView: { log in AnyView(MyCallHeader(log)) })
> ```

> [tab] UIKit
>
> The header is not replaced. `messageHeader` is public: configure it.

***

## Advanced Methods

### Store Access

`CallLogDetailsStore` fetches the log's user or group and pages its History.

> [tab] SwiftUI
>
> Pass your own to show a fixed screen in a preview:
>
> ```swift theme={null}
> #Preview {
>     NavigationStack {
>         CometChatCallLogDetails(callLog: ChatCallLog.samples[0],
>                                 store: CallLogDetailsStore(seeded: ChatCallLog.samples[0],
>                                                            history: .populated(ChatCallLog.samples, hasMore: false)))
>     }
> }
> ```
>
> A seeded store fetches nothing. `store.user` / `store.group` are the fetched party;
> `store.history` is the History tab's `CallLogsStore`.

> [tab] UIKit
>
> The view controller's store is `callLogDetailsStore`.

### Subclassing

> [tab] SwiftUI
>
> `CometChatCallLogDetails` is a `View` struct. Customise it with its parameters, `headerView` and style.

> [tab] UIKit
>
> The view controller is `open`; `buildUI()` and `setupStyle()` are its override points:
>
> ```swift theme={null}
> final class BrandedCallLogDetails: CometChatCallLogDetails {
>     override func setupStyle() {
>         super.setupStyle()
>         view.backgroundColor = .secondarySystemBackground
>     }
> }
> ```

***

## Style

`CometChatCallLogDetailsStyle` is sparse: set only what you change.

> [tab] SwiftUI
>
> ```swift theme={null}
> var style = CometChatCallLogDetailsStyle()
> style.infoCardBackgroundColor = .yellow.opacity(0.2)
> style.tabIndicatorColor = .orange
> style.recordingActionTint = .orange
>
> CometChatCallLogDetails(callLog: sampleCallLog, style: style)
> ```

> [tab] UIKit
>
> Set the static default for every screen, or one screen's `style`:
>
> ```swift theme={null}
> CometChatCallLogDetails.style.tabIndicatorColor = .systemOrange
>
> let details = CometChatCallLogDetails(callLog: sampleCallLog)
> details.style.infoCardBackgroundColor = .systemYellow.withAlphaComponent(0.2)
> details.style.recordingActionTint = .systemOrange
> ```

| Property | Styles |
| - | - |
| `backgroundColor`, `navigationBarItemsTintColor` | the screen and its bar |
| `infoCardBackgroundColor`, `infoCardCornerRadius`, `infoCardTitle…`, `infoCardDate…`, `infoCardDuration…` | the card — `background3`, radius 4 by default |
| `incomingCallIcon…`, `outgoingCallIcon…`, `missedCallIcon…` | the direction icons on the card and in History |
| `tabTextColor`, `tabSelectedTextColor`, `tabTextFont`, `tabIndicatorColor`, `tabSeparatorColor` | the tab strip |
| `rowTitle…`, `rowSubtitle…`, `rowDuration…`, `rowAvatarStyle`, `recordingDateFont` | the tabs' rows |
| `recordingActionTint` | **Play** and **Download** — `iconTintHighlight` |
| `emptyState…`, `errorState…`, `retryButton…` | the tabs' state views |

***

## Next Steps

> [card] [Call Logs](https://www.cometchat.com/docs/ui-kit/ios/v6/call-logs.md)
>
> The list that opens this screen

> [card] [Message Header](https://www.cometchat.com/docs/ui-kit/ios/v6/message-header.md)
>
> The header shown at the top

> [card] [Call Buttons](https://www.cometchat.com/docs/ui-kit/ios/v6/call-buttons.md)
>
> Start a call from the header

> [card] [Call Features](https://www.cometchat.com/docs/ui-kit/ios/v6/call-features.md)
>
> How calls ring and are presented


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.