# Main configurations

## **Vehicle type**

The UI vehicle module allows the selection of two vehicle types: (1) cars and (2) trucks.\
The selection of user-configurable vehicle types is performed via the `DKVehicleTypes` enum.

You can define vehicle types to be used by calling the following method:

```swift
DriveKitVehiculeUI.shared.configureVehicleTypes(types: [.car, .truck])
```

**Settings:**

* `.car`
* `.truck`

**Default value:** \[`.car`, `.truck`]

If an empty array is set, previous configured values will be kept.

## **Vehicle selection mode**

DriveKit Vehicle UI allows you to choose between two types of vehicle selection modes with the `DKCategoryConfigType` variable.

![Method to select a generic vehicle from its category](https://2525923625-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LXYIG5U3AO65YYFWJRK%2Fuploads%2F1KkTLxVdlDopcME1NMdg%2Fimage.png?alt=media\&token=d49f757e-7abe-4909-a0d6-61f53a905ce0)

![Method to select a vehicle from its brand, version and model](https://2525923625-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LXYIG5U3AO65YYFWJRK%2Fuploads%2FKMrgsoR9MRHeWzwReKQT%2Fimage.png?alt=media\&token=989de320-e188-48c4-89f6-28b0d2d5736d)

You can choose which mode you want to use by calling the following method:

```swift
DriveKitVehiculeUI.shared.configureCategoryConfigType(type: DKCategoryConfigType)
```

**Settings:**

* `liteConfigOnly`: the driver simply selects a default vehicle model corresponding to a category (city car, sedan, utility vehicle, etc.). The characteristics of the vehicle will be those of a default model chosen to represent this vehicle category.
* `brandsConfigOnly`: the process of adding a vehicle requires more steps that lead to the exact selection of the user's vehicle.
* `bothConfig`: both modes are available to the user. The user starts by selecting a vehicle category. If he wishes, he can stop at this stage, otherwise he can proceed with the other steps.

**Default value:** `bothConfig`

## **Selection of the auto start mode**

The SDK allows 4 configurations for the automatic start of the trip analysis. This configuration is controlled via `DKDetectionMode`.

You can choose which detection mode(s) to display by calling the following method:

```swift
DriveKitVehicleUI.shared.configureDetectionModes(detectionModes: [DKDetectionMode])
```

**Settings:**&#x20;

* `disabled`
* `gps`
* `beacon`
* `bluetooth`

**Default value**: \[ `disabled`, `gps`, `beacon`, `bluetooth` ]

## Vehicle mileage tracking and editing

The vehicle UI component includes a simple and powerful feature to automatically track vehicle mileage and manually add a mileage record. The mileage computation is based on the sum of the trip distances for all the trips recorded automatically.&#x20;

If some trips are lost or if you notice a difference between the mileage measured by the SDK and the mileage displayed on the vehicle's odometer, it is possible to correct the value and manually add the real value.

![](https://2525923625-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LXYIG5U3AO65YYFWJRK%2Fuploads%2FRy23576vqiLabZX59vKm%2Fimage.png?alt=media\&token=aaaed426-39fe-4092-b5b8-ad2408fcbced)

### **Enable mileage tracking**

By default, the mileage tracking feature is disabled, if you wish to enable it, simply use the method below:

```swift
DriveKitVehicleUI.shared.enableOdometer(true)
```

### **Display mileage tracking**

To get the UIViewController showing the odometer of each of your vehicles, call the following method:

```swift
import DriveKitVehicleUI
...
DriveKitVehicleUI.shared.getOdometerUI()
```

This screen will present the odometer of the first vehicle of the list (sorted alphabetically), and it is then possible to select another vehicle.

If you want to directly show the odometer of a particular vehicle, you can pass the vehicle identifier of this vehicle in parameters:

```swift
import DriveKitVehicleUI
...
DriveKitVehicleUI.shared.getOdometerUI(vehicleId: <id_of_the_vehicle>)
```

## Find my vehicle

The **Vehicle** component includes a feature that helps users easily find where they parked their vehicle. It displays the user’s current location alongside the vehicle’s last known location and, if needed, offers to launch a route from the user’s current position to the vehicle using their preferred navigation app.

This feature uses the [`getVehicleLocation()`](https://docs.drivequant.com/ios/vehicle-management#get-vehicle-last-location) method from the Vehicle component to retrieve the vehicle’s last known location.

<figure><img src="https://2525923625-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LXYIG5U3AO65YYFWJRK%2Fuploads%2FG9ZMaaZeAbyJeJaBn8Ul%2FFind%20My%20Vehicle%20-%20Public%20doc%20-%20iOS.png?alt=media&#x26;token=c9310b85-40a2-4b7c-861a-cbb8ac252c99" alt=""><figcaption></figcaption></figure>

To integrate and display “Find my vehicle” screen within your application, invoke the following method:

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

```swift
DriveKitVehicleUI.shared.getFindMyVehicleViewController(vehicleId: "my_vehicle_id")
```

{% endtab %}
{% endtabs %}

If you don’t have a vehicle identifier, you can also get the location of the latest used vehicle. This feature uses [`getLastVehicleTripLocation()`](https://docs.drivequant.com/trip-analysis/ios/tripmanagement#get-last-vehicle-trip-location) method from TripAnalysis module

To integrate and display “Find my vehicle” screen within your application, invoke the following method:

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

```swift
DriveKitVehicleUI.shared.getFindMyVehicleViewController()
```

{% 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/vehicle/user-interface/ios/main-configurations.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.
