LogoLogo
ProductsUse casesDocsSupport
  • Introducing DriveKit
  • DriveKit Guides
  • Get started with drivekit
    • Trip recording lifecycle
    • iOS
      • 🚀Quick start
      • Advanced configurations
      • References
      • iOS DriveKit Demo App
    • Android
      • 🚀Quick start
      • Advanced configurations
      • References
      • Android DriveKit Demo App
      • Android 15 Migration guide
      • Android 14 Migration guide
      • Troubleshooting
  • Trip analysis
    • Introduction
    • iOS
      • Permissions
      • Trip management
      • TripListener
      • Crash Detection
      • Beacon usage
      • Bluetooth usage
      • Custom metadata
      • References (iOS)
    • Android
      • Runtime permissions
      • Trip management
      • TripListener
      • Crash Detection
      • Beacon usage
      • Bluetooth usage
      • Custom metadata
      • References (Android)
    • User interface
      • iOS
        • Get started
        • Working hours
        • Driver alert in case of crash
        • Trip recording widget
        • Location sharing
      • Android
        • Get started
        • Working hours
        • Driver alert in case of crash
        • Trip recording widget
        • Location sharing
    • REST services
      • Trip
      • References
    • Trip Simulator
      • iOS
      • Android
  • PERMISSIONS UTILS
    • Introduction
    • User interface
      • iOS
        • Get started
        • Main configurations
      • Android
        • Get started
        • Main configurations
  • COMMON UI
    • Introduction
    • iOS
      • Get started
    • Android
      • Get started
    • References
  • DRIVER DATA
    • Introduction
    • iOS
      • Get started
      • References (iOS)
    • Android
      • Get started
      • References (Android)
    • User interface
      • iOS
        • Get started
        • Advanced configurations
        • Trips widgets
        • My Synthesis
        • My Driver Profile
      • Android
        • Get Started
        • Advanced configurations
        • Trips widgets
        • My Synthesis
        • My Driver Profile
  • Driver Data Timeline UI
    • Introduction
    • iOS
      • Get started
    • Android
      • Get started
  • Vehicle
    • Introduction
    • iOS
      • Get started
      • Vehicle management
      • Beacon management
      • Bluetooth device management
      • Odometer
      • References (iOS)
    • Android
      • Get started
      • Vehicle management
      • Beacon management
      • Bluetooth device management
      • Odometer
      • References (Android)
    • User interface
      • iOS
        • Get started
        • Main configurations
        • Advanced configurations
      • Android
        • Get started
        • Main configurations
        • Advanced configurations
  • DRIVER ACHIEVEMENT
    • Introduction
    • iOS
      • Get started
    • Android
      • Get Started
    • User interface
      • iOS
      • Android
  • CHALLENGE
    • Introduction
    • Important challenge rules
    • iOS
      • Get started
      • References (iOS)
    • Android
      • Get started
      • References (Android)
    • User interface
      • iOS
        • Get started
      • Android
        • Get started
  • GROUP
    • Introduction
    • iOS
      • Get started
    • Android
      • Get started
  • React Native
    • Get started
    • Integration
  • Flutter
    • Get started
    • Integration
  • Push services
    • Introduction
    • Push Trip Data
    • Push Deleted trip
    • Push Crash Data
    • Push Diagnosis Data
  • ADMIN SERVICES
    • Beacon
      • Add
      • Replace
      • Delete
      • Configuration
    • Challenges
      • List of challenges
      • Challenge details
      • Registered users
      • Challenge ranking
      • Users' progress
      • Definitions
    • Customer
      • Activity timeline
    • Driver
      • Timeline
      • Synthesis
      • Identity
      • Status
      • Add or update a metadata
      • Vehicles
      • Profile
      • Application diagnoses
    • Drivers
      • Account
      • Statistics
      • Ranking
      • Expired accounts
    • Group
      • Timeline
      • Synthesis
    • Trips
      • Add or update a metadata
      • Delete a metadata
    • Vehicle
      • Create
      • Characteristics
      • Configuration
      • Statistics
      • Update mileage
      • Tire and brake wear update
      • References
  • Crashes
    • Annotate a crash
    • Revoke crash location URL
  • ENTERPRISE SERVICES
    • Introduction
    • Teams
      • Create a team
      • List of teams
      • Enable or disable a team
    • Hyper-admins
      • Create a hyper-admin
      • List of hyper-admins
      • Delete a hyper-admin
    • Monitoring
      • Get a push trip data report
      • Get a push crash data report
      • Request to retry failed trips
      • Request to retry failed crashes
      • Get the status of a task
  • Release notes
    • Changelog
      • iOS
      • Android
      • UI iOS
      • UI Android
Powered by GitBook
On this page
  • Get the framework
  • Initialize
  • Override colors and texts
  • Select Streak themes
  • Display streak list interface
  • Select Badges categories
  • Display Badge list interface
  • Select ranking themes
  • Set ranking selectors
  • Configure ranking depth
  • Display Ranking interface

Was this helpful?

Export as PDF
  1. DRIVER ACHIEVEMENT
  2. User interface

iOS

PreviousUser interfaceNextAndroid

Last updated 1 year ago

Was this helpful?

Get the framework

The Driver Achievement UI SDK 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 'DriveKitDriverAchievementUI'
end

Then, run pod install.

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

Initialize

If you have , the Driver Achievement UI module must also be manually initialized. In the application's AppDelegate file, import DriveKitDriverAchievementUI.

import DriveKitDriverAchievementUI

‌Then, to initialize the Driver Achievement UI SDK in your app, you must call the initialization method in didFinishLaunchingWithOptions method of your AppDelegate.

import DriveKitCore
import DriveKitCommonUI
import DriveKitDriverAchievementUI

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

Override colors and texts

Select Streak themes

You can choose which streak theme you want to display in which order by calling the following method:

DriveKitDriverAchievementUI.shared.configureStreakThemes(streakThemes: [StreakDataType])

Accepted values:

  • .phoneDistraction

  • .safety

  • .acceleration

  • .brake

  • .adherence

  • .speedLimits

  • .call

Default value:

[.phoneDistraction, .safety, .acceleration, .brake, .adherence, .call]

For speedLimits streaks, make sure that the service is activated on your DriveQuant account.

Display streak list interface

To get the streak list view controller, you can call the following method:

DriveKitDriverAchievementUI.shared.getStreakViewController()

Select Badges categories

You can choose which badge category you want to display in which order by calling the following method:

DriverAchievementUI.shared.configureBadgeCategories(badgeCategories: [DKBadgeCatergory])

Accepted values:

  • .generic

  • .ecodriving

  • .safety

  • .phoneDistraction

Default value:

[.generic, .ecodriving, .safety, .phoneDistraction]

Badges belonging to the generic category (.generic) are always displayed. It is not possible to hide these badges.

Display Badge list interface

To show the badges list view controller, you can use the following method:

DriveKitDriverAchievementUI.shared.getBadgesViewController()

Select ranking themes

By calling the following method, you can choose which ranking types you want to display:

DriveKitDriverAchievementUI.shared.configureRankingTypes([DKRankingType])

Accepted values:

  • .ecodriving

  • .safety

  • .distraction

  • .speeding

Default value:

[.safety, .ecoDriving, .distraction]

Set ranking selectors

This method allows you to change the displayed periods of ranking:

DriveKitDriverAchievementUI.shared.configureRankingSelector(DKRankingSelectorType)

Accepted values:

  • .none

  • .period

Default value:.period(rankingPeriods: [.weekly, .monthly, .allTime])

If the DKRankingSelectorType ".none" is selected, the period “weekly” will be taken into consideration for rankings.

Configure ranking depth

This method allows you to choose the ranking depth you want to display:

DriveKitDriverAchievementUI.shared.configureRankingDepth(Int)

Default value: 5

Accepted values: from 5 to 20

Display Ranking interface

To display the ranking view controller, you can call the following method:

DriveKitDriverAchievementUI.shared.getRankingViewController()

To override colors and texts in the Driver Achievement UI SDK, see .

Common UI configuration
Github repository
disabled the SDK auto-initialization