TKTripKit

Objective-C

@interface TKTripKit : NSObject

@property (nonatomic, strong) NSManagedObjectModel          *managedObjectModel;
@property (nonatomic, strong, null_resettable) NSPersistentStoreCoordinator  *persistentStoreCoordinator;
@property (nonatomic, strong, null_resettable) NSManagedObjectContext        *tripKitContext;

+ (NSManagedObjectModel *)tripKitModel;

+ (NSBundle *)bundle;

+ (TKTripKit *)sharedInstance NS_REFINED_FOR_SWIFT;

/**
 Reloads the coordinator and context, which will be set to new instances. Call this when using multiple TripKit instances in different processes and they went out of sync.
 */
- (void)reload;

/**
 Wipes TripKit and effectively clears the cache. Following calls to the context and coordinator will return new instances, so make sure you clear local references to those.
 */
- (void)reset;

/**
 The date TripKit was last reset when the context and coordinator were initialised. If you have multiple TripKit instances in different processes accessing the same underlying store, you can use this to determine if they are still in sync. If they aren't you'll likely want to call `reload` on the TripKit instance which wasn't reloaded since the other one was reset.
 
 @return Reset date as when the context/coordinator were initialised
 */
- (nonnull NSDate *)resetDateFromInitialization;

- (NSCache *)inMemoryCache;

@end

Swift

class TKTripKit : NSObject

Undocumented

  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, strong) NSManagedObjectModel *managedObjectModel

    Swift

    var managedObjectModel: NSManagedObjectModel { get set }
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, strong, null_resettable) NSPersistentStoreCoordinator *persistentStoreCoordinator

    Swift

    var persistentStoreCoordinator: NSPersistentStoreCoordinator! { get set }
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, strong, null_resettable) NSManagedObjectContext *tripKitContext

    Swift

    var tripKitContext: NSManagedObjectContext! { get set }
  • Undocumented

    Declaration

    Objective-C

    + (NSManagedObjectModel *)tripKitModel;

    Swift

    class func tripKitModel() -> NSManagedObjectModel
  • Undocumented

    Declaration

    Objective-C

    + (NSBundle *)bundle;

    Swift

    class func bundle() -> Bundle
  • Undocumented

    Declaration

    Objective-C

    + (TKTripKit *)sharedInstance NS_REFINED_FOR_SWIFT;

    Swift

    class func __sharedInstance() -> TKTripKit
  • Reloads the coordinator and context, which will be set to new instances. Call this when using multiple TripKit instances in different processes and they went out of sync.

    Declaration

    Objective-C

    - (void)reload;

    Swift

    func reload()
  • Wipes TripKit and effectively clears the cache. Following calls to the context and coordinator will return new instances, so make sure you clear local references to those.

    Declaration

    Objective-C

    - (void)reset;

    Swift

    func reset()
  • The date TripKit was last reset when the context and coordinator were initialised. If you have multiple TripKit instances in different processes accessing the same underlying store, you can use this to determine if they are still in sync. If they aren’t you’ll likely want to call reload on the TripKit instance which wasn’t reloaded since the other one was reset.

    Declaration

    Objective-C

    - (nonnull NSDate *)resetDateFromInitialization;

    Swift

    func resetDateFromInitialization() -> Date

    Return Value

    Reset date as when the context/coordinator were initialised

  • Undocumented

    Declaration

    Objective-C

    - (NSCache *)inMemoryCache;

    Swift

    func inMemoryCache() -> NSCache<AnyObject, AnyObject>
  • Declaration

    Swift

    @objc
    public static func prepareForNewSession()
  • Declaration

    Swift

    @objc
    public static func setAPIKey(_ key: String)