Get started

Prerequisite

Before starting DriveKit Challenge UI integration, make sure that you have initialized Challenge and Common UI modules.

Integration

The Challenge UI module is available on Cocoapods master repo.
To access the framework in the repository, add the following lines to your Podfile:
1
target 'my-target' do
2
pod 'DriveKitChallengeUI'
3
end
Copied!
Then, run pod install.
On this Github repository, you can find also a demo application that contains the DriveKit challenge component. This code is open source and you can use it as an example.

Initialization

An initialization phase is required to use the feature included in the Challenge UI module. In the application's AppDelegate file, import DriveKitChallengeUI:
1
import DriveKitChallengeUI
Copied!
Then, to initialize Challenge UI module in your app, you must call the initialization method in didFinishLaunchingWithOptions method of your AppDelegate:
1
import DriveKitCore
2
import DriveKitCommonUI
3
import DriveKitChallengeUI
4
5
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
6
DriveKit.shared.initialize()
7
DriveKitUI.shared.initialize()
8
DriveKitChallengeUI.shared.initialize()
9
...
10
}
Copied!

Display Challenge List

To display the challenges list, just call the following method:
1
self.navigationController?.pushViewController(DriveKitChallengeUI.shared.getChallengeListViewController(), animated: true)
Copied!
Last modified 5mo ago