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:
1
DriveKitVehiculeUI.shared.configureVehicleTypes(types: [.car, .truck])
Copied!
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
Method to select a vehicle from its brand, version and model
You can choose which mode you want to use by calling the following method:
1
DriveKitVehiculeUI.shared.configureCategoryConfigType(type : DKCategoryConfigType)
Copied!
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:
1
DriveKitVehicleUI.shared.configureDetectionModes(detectionModes: [DKDetectionMode])
Copied!
Settings:
  • 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.
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.

Enable mileage tracking

By default, the mileage tracking feature is disabled, if you wish to enable it, simply use the method below:
1
DriveKitVehicleUI.shared.enableOdometer(true)
Copied!

Display mileage tracking

To get the UIViewController showing the odometer of each of your vehicles, call the following method:
1
import DriveKitVehicleUI
2
...
3
DriveKitVehicleUI.shared.getOdometerUI()sw
Copied!
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:
1
import DriveKitVehicleUI
2
...
3
DriveKitVehicleUI.shared.getOdometerUI(vehicleId: <id_of_the_vehicle>)
Copied!