TripKit SDK for iOS

This is the documentation of TripKit iOS, the iOS SDK for the TripGo API.

The SDK consists of the following three frameworks:

TripKit contains the core logic, and the other two depend on it..

Installation

Swift Package Manager

Full support for SPM is incoming in the upcoming version 5.0. For now, you can use the main branch.

Add it to your dependencies:

.package(name: "TripKit", url: "https://github.com/skedgo/tripkit-ios", branch: "main")

And then add the TripKit, TripKitUI, and/or TripKitInterApp dependencies to your target, as appropriate.

Cocoapods

Add desired pods to your Podfile:

use_frameworks!

pod 'TripKit'
pod 'TripKitUI'
pod 'TripKitInterApp'

Then run pod update and you're set.

If you get a "Sandbox" error, make sure that your ENABLE_USER_SCRIPT_SANDBOXING is set to 'No', see Stack Overflow.

Manually

If there's any trouble with that, see the examples in the repository.

Set-up

First up, sign up for a TripGo API key.

In your app delegate, provide your API key and start a new session:

import TripKit

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

  TripKit.apiKey = "MY_API_KEY"
  TripKit.prepareForNewSession()

  // ...
}

You can then start using TripKit and TripKitUI, e.g.:

import TripKitUI

let controller = TKUIHomeViewController()
present(controller, animated: true)

Have a look at the TripKitUIExample in the GitHub repository, as well as the SDK Reference at the top of this page.