Get started
Prerequisite
Before starting DriveKit Timeline UI integration, make sure that you have initialized Driver Data and Common UI modules.
Integration
To add the Timeline UI module to your app:
Swift Package Manager: Add
DriveKitDriverDataTimelineUI
from repository:https://github.com/DriveQuantPublic/drivekit-ui-ios.git
as dependency.Cocoapods (deprecation scheduled for the end of 2025): add the following pod to your Podfile
target 'my-target' do
pod 'DriveKitDriverDataTimelineUI'
end
Then, run pod install.
Initialization
If you have disabled the SDK auto-initialization, the Timeline UI module must also be manually initialized. In the application's AppDelegate file, import DriveKitDriverDataTimelineUI
:
import DriveKitDriverDataTimelineUI
Then, to initialize Timeline UI module in your app, you must call the initialization method in didFinishLaunchingWithOptions
method of your AppDelegate:
import DriveKitCore
import DriveKitCommonUI
import DriveKitDriverDataTimelineUI
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
DriveKit.shared.initialize()
DriveKitUI.shared.initialize()
DriveKitDriverData.shared.initialize()
DriveKitDriverDataTimelineUI.shared.initialize()
//...
}
Configure main screen scores
You can select which scores you want to display on the main screen as well as the scores ordering, by calling the following method:
DriveKitUI.shared.scores = [.safety, .ecoDriving, .distraction, .speeding]
Default and accepted values:
[ .safety
, .ecoDriving
, .distraction
, .speeding
]
For .distraction
and .speeding
scores, make sure that the services are activated on your DriveQuant account or the SDK will filter them out and they will not be displayed in the UI even if you add them here.
Last updated
Was this helpful?