# Get started

## **Prerequisite**

Before starting DriveKit Trip Analysis UI integration, make sure that you have initialized TripAnalysis and [CommonUI](/common-ui/ios/get-started.md#initialization) modules, especially if you have [disabled the SDK auto-initialization](/get-started-drivekit/ios/advanced-configurations.md#manually-initialize-core-module).

## **Integration**

The Trip Analysis UI module is available on Swift Package Manager and Cocoapods master repo.

{% hint style="info" %}
On this [Github repository](https://github.com/DriveQuantPublic/drivekit-ui-ios), you also have a demo app and source code of Driver Data UI that you can use as an example.
{% endhint %}

### Swift Package Manager

#### Via Xcode:

* In Xcode, add the DriveKitUI SDK by navigating to File > Add Package Dependencies...
* In the prompt that appears, enter the DriveKitUI repository:\
  `https://github.com/DriveQuantPublic/drivekit-ui-ios.git`&#x20;
* Include DriveKitTripAnalysisUI in your app.

#### Via Package.swift:

* To integrate DriveKitUI to a Swift package via a `Package.swift` file, you can add DriveKitUI to the dependencies array of your package. For more details, see the [Swift Package Manager documentation](https://docs.swift.org/package-manager/PackageDescription/PackageDescription.html#package-dependency).

```swift
dependencies: [
  .package(name: "DriveKitUI",
           url: "https://github.com/DriveQuantPublic/drivekit-ui-ios.git",
           from: "2.0.0"),
  // ...
],
```

* Then in your target, add DriveKitTripAnalysisUI to the dependencies array of that target:

```swift
.target(
  name: "MyTarget",
  dependencies: [
    .product(name: "DriveKitTripAnalysisUI", package: "DriveKitUI"),
    // ...
  ]
),
```

### Cocoapods (deprecation scheduled for the end of 2025)

To add TripAnalysisUI module, add the following line to your Podfile:

{% tabs %}
{% tab title="Podfile" %}

```ruby
target 'my-target' do
  pod 'DriveKitTripAnalysisUI'
end
```

{% endtab %}
{% endtabs %}

Then, run `pod install`.

## **Initialization**

If you have [disabled the SDK auto-initialization](/get-started-drivekit/ios/advanced-configurations.md#manually-initialize-core-module), the Trip Analysis UI module must also be manually initialized. In the application's AppDelegate file, import DriveKitTripAnalysisUI:

```swift
import DriveKitTripAnalysisUI
```

Then, to initialize Trip Analysis UI SDK in your app, you must call the initialization method in `didFinishLaunchingWithOptions` method of your AppDelegate:

{% tabs %}
{% tab title="AppDelegate.swift" %}

```swift
import DriveKitCoreModule
import DriveKitCommonUI
import DriveKitTripAnalysisModule
import DriveKitTripAnalysisUI

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    DriveKit.shared.initialize()
    DriveKitTripAnalysis.shared.initialize(appLaunchOptions: launchOptions)
    DriveKitUI.shared.initialize()
    DriveKitTripAnalysisUI.shared.initialize()
    ...    
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.drivequant.com/trip-analysis/user-interface/ios/get-started.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
