Get started

Prerequisite

Before starting DriveKit Trip Analysis UI integration, make sure that you have initialized TripAnalysis and CommonUI modules.

Integration

The Trip Analysis UI module is available on Cocoapods master repo. To access the framework in the repository, add the following lines to your Podfile:

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

Then, run pod install.

On this Github repository, you also have a demo app and source code of Driver Data UI that you can use as an example.

Initialization

An initialization phase is required to use the feature included in the Trip Analysis UI SDK. In the application's AppDelegate file, import DriveKitTripAnalysisUI:

import DriveKitTripAnalysisUI

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

import DriveKitCoreModule
import DriveKitCommonUI
import DriveKitTripAnalysisModule
import DriveKitTripAnalysisUI

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

Last updated