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:

You can use them individually, but note that the latter two depend on the first one.

Installation

Carthage

Add this to your Cartfile:

git "https://gitlab.com/SkedGo/iOS/tripkit-ios.git" "master"

Then run carthage update and add the desired framework to your project as described in the Carthage docs.

When doing so, you'll need to add the respective dependencies:

Cocoapods

Add desired pods to your Podfile:

use_frameworks!

pod 'TripKit',          :git => 'https://gitlab.com/SkedGo/iOS/tripkit-ios.git'
pod 'TripKitUI',        :git => 'https://gitlab.com/SkedGo/iOS/tripkit-ios.git'
pod 'TripKitInterApp',  :git => 'https://gitlab.com/SkedGo/iOS/tripkit-ios.git'

Then run pod update and you're set.

Manually

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

Set-up

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()

  // ...
}
@import TripKit;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

  [TKTripKit setAPIKey:@"MY_API_KEY"];
  [TKTripKit prepareForNewSession];

  // ...
}

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

import TripKitUI

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