diff --git a/BDKAutomatic.podspec b/BDKAutomatic.podspec deleted file mode 100644 index 573f1d1..0000000 --- a/BDKAutomatic.podspec +++ /dev/null @@ -1,24 +0,0 @@ -Pod::Spec.new do |s| - s.name = "BDKAutomatic" - s.version = "0.1.0" - s.summary = "A framework for talking to the Automatic API." - s.homepage = "https://github.com/kreeger/BDKAutomatic" - s.license = 'MIT' - s.author = { "Ben Kreeger" => "ben@kree.gr" } - s.source = { :git => "https://github.com/kreeger/BDKAutomatic.git", :tag => "v#{s.version}" } - - s.ios.deployment_target = '7.0' - s.osx.deployment_target = '10.8' - s.requires_arc = true - - s.subspec 'Adapter' do |sub| - sub.source_files = 'Classes/*.{h,m}' - sub.dependency 'AFNetworking/Serialization', '>= 2.0.0' - sub.dependency 'AFNetworking/NSURLSession', '>= 2.0.0' - end - - s.subspec 'MKPolyline' do |sub| - sub.source_files = 'Classes/MapKit/*.{h,m}' - sub.frameworks = 'MapKit' - end -end diff --git a/Classes/AFHTTPRequestOperation+NLAutomaticOperation.h b/Classes/AFHTTPRequestOperation+NLAutomaticOperation.h new file mode 100644 index 0000000..824166a --- /dev/null +++ b/Classes/AFHTTPRequestOperation+NLAutomaticOperation.h @@ -0,0 +1,14 @@ +// +// AFHTTPRequestOperation+NLAutomaticOperation.h +// Pods +// +// Created by Nelson LeDuc on 4/6/15. +// +// + +#import +#import "NLAutomaticOperation.h" + +@interface AFHTTPRequestOperation (NLAutomaticOperation) + +@end diff --git a/Classes/AFHTTPRequestOperation+NLAutomaticOperation.m b/Classes/AFHTTPRequestOperation+NLAutomaticOperation.m new file mode 100644 index 0000000..13c7394 --- /dev/null +++ b/Classes/AFHTTPRequestOperation+NLAutomaticOperation.m @@ -0,0 +1,28 @@ +// +// AFHTTPRequestOperation+NLAutomaticOperation.m +// Pods +// +// Created by Nelson LeDuc on 4/6/15. +// +// + +#import "AFHTTPRequestOperation+NLAutomaticOperation.h" + +@implementation AFHTTPRequestOperation (NLAutomaticOperation) + +- (void)cancelAutomaticOperation +{ + [self cancel]; +} + +- (void)pauseAutomaticOperation +{ + [self pause]; +} + +- (void)resumeAutomaticOperation +{ + [self resume]; +} + +@end diff --git a/Classes/BDKAutomatic.h b/Classes/BDKAutomatic.h deleted file mode 100644 index e3a3e75..0000000 --- a/Classes/BDKAutomatic.h +++ /dev/null @@ -1,53 +0,0 @@ -// -// BDKAutomatic.h -// BDKAutomatic -// -// Created by Ben Kreeger on 1/20/14. -// Copyright (c) 2014 Ben Kreeger. All rights reserved. -// - -@import Foundation; - -#import - -#import "BDKAutomaticScopes.h" -#import "BDKAutomaticToken.h" - -typedef void(^BDKAutomaticCompletionBlock)(NSError *error, id responseObject); -typedef void(^BDKAutomaticTokenCompletionBlock)(NSError *error, BDKAutomaticToken *token); - -@interface BDKAutomatic : AFHTTPRequestOperationManager - -@property (readonly) NSString *clientId; -@property (readonly) NSString *clientSecret; -@property (readonly) NSURL *redirectUrl; -@property (strong, nonatomic) BDKAutomaticToken *token; - -#pragma mark - Lifecycle - -- (instancetype)initWithClientId:(NSString *)clientId - clientSecret:(NSString *)clientSecret - redirectUrl:(NSURL *)redirectUrl; -- (instancetype)initWithClientId:(NSString *)clientId - clientSecret:(NSString *)clientSecret - redirectUrl:(NSURL *)redirectUrl - token:(BDKAutomaticToken *)token; - -#pragma mark - Authentication and authorization - -- (NSURLRequest *)authenticationRequestForAllScopes; -- (NSURLRequest *)authenticationRequestForScopes:(NSArray *)scopes; -- (void)getAccessTokenForCode:(NSString *)code completion:(BDKAutomaticTokenCompletionBlock)completion; - -#pragma mark - Trip data - -- (void)getTrips:(BDKAutomaticCompletionBlock)completion; - -@end - - -@interface NSString (URLEncoding) - -- (NSString *)urlEncodeUsingEncoding:(NSStringEncoding)encoding; - -@end \ No newline at end of file diff --git a/Classes/BDKAutomatic.m b/Classes/BDKAutomatic.m deleted file mode 100644 index 8203fe7..0000000 --- a/Classes/BDKAutomatic.m +++ /dev/null @@ -1,137 +0,0 @@ -// -// BDKAutomatic.m -// BDKAutomatic -// -// Created by Ben Kreeger on 1/20/14. -// Copyright (c) 2014 Ben Kreeger. All rights reserved. -// - -#import "BDKAutomatic.h" - -#import "BDKAutomaticTrip.h" - -@implementation BDKAutomatic - -@synthesize clientId = _clientId; -@synthesize clientSecret = _clientSecret; -@synthesize redirectUrl = _redirectUrl; - -#pragma mark - Lifecycle - -- (instancetype)initWithClientId:(NSString *)clientId - clientSecret:(NSString *)clientSecret - redirectUrl:(NSURL *)redirectUrl { - return [self initWithClientId:clientId clientSecret:clientSecret redirectUrl:redirectUrl token:nil]; -} - -- (instancetype)initWithClientId:(NSString *)clientId - clientSecret:(NSString *)clientSecret - redirectUrl:(NSURL *)redirectUrl - token:(BDKAutomaticToken *)token { - self = [super initWithBaseURL:[NSURL URLWithString:@"https://api.automatic.com"]]; - if (!self) return nil; - - _clientId = clientId; - _clientSecret = clientSecret; - _redirectUrl = redirectUrl; - [self setToken:token]; - - return self; -} - -#pragma mark - Properties - -- (void)setToken:(BDKAutomaticToken *)token { - _token = token; - NSString *value = token ? [NSString stringWithFormat:@"token %@", token.accessToken] : @""; - [self.requestSerializer setValue:value forHTTPHeaderField:@"Authorization"]; -} - -#pragma mark - Authentication and authorization - -- (NSURLRequest *)authenticationRequestForAllScopes { - NSArray *scopes = @[BDKAutomaticScopeIgnitionOff, - BDKAutomaticScopeIgnitionOn, - BDKAutomaticScopeLocation, - BDKAutomaticScopeMILOff, - BDKAutomaticScopeMILOn, - BDKAutomaticScopeNotificationHardAcceleration, - BDKAutomaticScopeNotificationHardBrake, - BDKAutomaticScopeNotificationSpeeding, - BDKAutomaticScopeParkingChanged, - BDKAutomaticScopeRegionChanged, - BDKAutomaticScopeTripSummary, - BDKAutomaticScopeVehicle, - ]; - return [self authenticationRequestForScopes:scopes]; -} - -- (NSURLRequest *)authenticationRequestForScopes:(NSArray *)scopes { - NSDictionary *params = @{@"client_id": self.clientId, - @"scope": [scopes componentsJoinedByString:@" "], - @"response_type": @"code"}; - NSMutableArray *components = [NSMutableArray array]; - [params enumerateKeysAndObjectsUsingBlock:^(NSString *key, NSString *value, BOOL *stop) { - key = [key urlEncodeUsingEncoding:NSUTF8StringEncoding]; - value = [value urlEncodeUsingEncoding:NSUTF8StringEncoding]; - [components addObject:[NSString stringWithFormat:@"%@=%@", key, value]]; - }]; - NSString *joinedParams = [components componentsJoinedByString:@"&"]; - NSString *baseURL = @"https://www.automatic.com/oauth/authorize"; - NSString *fullUrl = [NSString stringWithFormat:@"%@?%@", baseURL, joinedParams]; - NSLog(@"Generated URL %@", fullUrl); - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:fullUrl]]; - return request; -} - -- (void)getAccessTokenForCode:(NSString *)code completion:(BDKAutomaticTokenCompletionBlock)completion { - NSString *url = @"https://www.automatic.com/oauth/access_token"; - NSDictionary *params = @{@"client_id": self.clientId, - @"client_secret": self.clientSecret, - @"code": code, - @"grant_type": @"authorization_code"}; - [self POST:url parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) { - self.token = [BDKAutomaticToken tokenWithDictionary:responseObject]; - if (completion) { - completion(nil, self.token); - } - } failure:^(AFHTTPRequestOperation *operation, NSError *error) { - if (completion) { - completion(error, nil); - } - }]; -} - -#pragma mark - Trip data - -- (void)getTrips:(BDKAutomaticCompletionBlock)completion { - NSString *url = @"/v1/trips"; - NSDictionary *params = @{}; - [self GET:url parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) { - NSMutableArray *mResults = [NSMutableArray array]; - [responseObject enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { - [mResults addObject:[[BDKAutomaticTrip alloc] initWithAPIObject:obj]]; - }]; - if (completion) { - completion(nil, [mResults copy]); - } - } failure:^(AFHTTPRequestOperation *operation, NSError *error) { - if (completion) { - completion(error, operation.responseObject); - } - }]; -} - -@end - - -@implementation NSString (URLEncoding) - -- (NSString *)urlEncodeUsingEncoding:(NSStringEncoding)encoding { - CFStringRef toEncode = (CFStringRef)@"!*'\"();@&=$,/?%#[]% "; - CFStringEncoding cEncoding = CFStringConvertNSStringEncodingToEncoding(encoding); - CFStringRef stringRef = CFURLCreateStringByAddingPercentEscapes(NULL, (CFStringRef)self, NULL, toEncode, cEncoding); - return (NSString *)CFBridgingRelease(stringRef); -} - -@end \ No newline at end of file diff --git a/Classes/BDKAutomaticScopes.h b/Classes/BDKAutomaticScopes.h deleted file mode 100644 index da76c9e..0000000 --- a/Classes/BDKAutomaticScopes.h +++ /dev/null @@ -1,22 +0,0 @@ -// -// BDKAutomaticScopes.h -// Pods -// -// Created by Ben Kreeger on 2/2/14. -// Copyright (c) 2014 Ben Kreeger. All rights reserved. -// - -@import Foundation; - -extern NSString * const BDKAutomaticScopeLocation; -extern NSString * const BDKAutomaticScopeVehicle; -extern NSString * const BDKAutomaticScopeTripSummary; -extern NSString * const BDKAutomaticScopeIgnitionOn; -extern NSString * const BDKAutomaticScopeIgnitionOff; -extern NSString * const BDKAutomaticScopeNotificationSpeeding; -extern NSString * const BDKAutomaticScopeNotificationHardBrake; -extern NSString * const BDKAutomaticScopeNotificationHardAcceleration; -extern NSString * const BDKAutomaticScopeRegionChanged; -extern NSString * const BDKAutomaticScopeParkingChanged; -extern NSString * const BDKAutomaticScopeMILOn; -extern NSString * const BDKAutomaticScopeMILOff; \ No newline at end of file diff --git a/Classes/BDKAutomaticScopes.m b/Classes/BDKAutomaticScopes.m deleted file mode 100644 index ba4a41e..0000000 --- a/Classes/BDKAutomaticScopes.m +++ /dev/null @@ -1,22 +0,0 @@ -// -// BDKAutomaticScopes.m -// Pods -// -// Created by Ben Kreeger on 2/2/14. -// Copyright (c) 2014 Ben Kreeger. All rights reserved. -// - -#import "BDKAutomaticScopes.h" - -NSString * const BDKAutomaticScopeLocation = @"scope:location"; -NSString * const BDKAutomaticScopeVehicle = @"scope:vehicle"; -NSString * const BDKAutomaticScopeTripSummary = @"scope:trip:summary"; -NSString * const BDKAutomaticScopeIgnitionOn = @"scope:ignition:on"; -NSString * const BDKAutomaticScopeIgnitionOff = @"scope:ignition:off"; -NSString * const BDKAutomaticScopeNotificationSpeeding = @"scope:notification:speeding"; -NSString * const BDKAutomaticScopeNotificationHardBrake = @"scope:notification:hard_brake"; -NSString * const BDKAutomaticScopeNotificationHardAcceleration = @"scope:notification:hard_accel"; -NSString * const BDKAutomaticScopeRegionChanged = @"scope:region:changed"; -NSString * const BDKAutomaticScopeParkingChanged = @"scope:parking:changed"; -NSString * const BDKAutomaticScopeMILOn = @"scope:mil:on"; -NSString * const BDKAutomaticScopeMILOff = @"scope:mil:off"; \ No newline at end of file diff --git a/Classes/MapKit/MKPolyline+BDKEncodedString.h b/Classes/MapKit/MKPolyline+NLEncodedString.h similarity index 79% rename from Classes/MapKit/MKPolyline+BDKEncodedString.h rename to Classes/MapKit/MKPolyline+NLEncodedString.h index 001c4e5..5af4494 100644 --- a/Classes/MapKit/MKPolyline+BDKEncodedString.h +++ b/Classes/MapKit/MKPolyline+NLEncodedString.h @@ -1,6 +1,6 @@ @import MapKit; -@interface MKPolyline (BDKEncodedString) +@interface MKPolyline (NLEncodedString) /** Praise be to http://stackoverflow.com/a/9219856/194869 diff --git a/Classes/MapKit/MKPolyline+BDKEncodedString.m b/Classes/MapKit/MKPolyline+NLEncodedString.m similarity index 95% rename from Classes/MapKit/MKPolyline+BDKEncodedString.m rename to Classes/MapKit/MKPolyline+NLEncodedString.m index cbd41fd..04c6ddb 100644 --- a/Classes/MapKit/MKPolyline+BDKEncodedString.m +++ b/Classes/MapKit/MKPolyline+NLEncodedString.m @@ -1,6 +1,6 @@ -#import "MKPolyline+BDKEncodedString.h" +#import "MKPolyline+NLEncodedString.h" -@implementation MKPolyline (BDKEncodedString) +@implementation MKPolyline (NLEncodedString) + (MKPolyline *)polylineWithEncodedString:(NSString *)encodedString { const char *bytes = [encodedString UTF8String]; diff --git a/Classes/NLAutomatic.h b/Classes/NLAutomatic.h new file mode 100644 index 0000000..ba22da7 --- /dev/null +++ b/Classes/NLAutomatic.h @@ -0,0 +1,63 @@ +// +// NLAutomatic.h +// NLAutomatic +// +// Created by Ben Kreeger on 1/20/14. +// Copyright (c) 2014 Ben Kreeger. All rights reserved. +// + +@import Foundation; +#import "NLAutomaticScopes.h" + +@class NLAutomaticToken; +@protocol NLAutomaticOperation; + +typedef void(^NLAutomaticCompletionBlock)(NSError *error, id responseObject); +typedef void(^NLAutomaticTokenCompletionBlock)(NSError *error, NLAutomaticToken *token); + +@interface NLAutomatic : NSObject + +@property (nonatomic, strong, readonly) NSString *clientId; +@property (nonatomic, strong, readonly) NSString *clientSecret; +@property (nonatomic, strong, readonly) NSURL *redirectUrl; +@property (nonatomic, strong) NLAutomaticToken *token; + +#pragma mark - Lifecycle + +- (instancetype)initWithClientId:(NSString *)clientId + clientSecret:(NSString *)clientSecret + redirectUrl:(NSURL *)redirectUrl; +- (instancetype)initWithClientId:(NSString *)clientId + clientSecret:(NSString *)clientSecret + redirectUrl:(NSURL *)redirectUrl + token:(NLAutomaticToken *)token; + +#pragma mark - Authentication and authorization + +- (NSURLRequest *)authenticationRequestForAllScopes; +- (NSURLRequest *)authenticationRequestForStandardScopes; +- (NSURLRequest *)authenticationRequestForScopes:(NSArray *)scopes; +- (void)getAccessTokenForCode:(NSString *)code completion:(NLAutomaticTokenCompletionBlock)completion; + +#pragma mark - Trip data + +- (id)getTrips:(NLAutomaticCompletionBlock)completion; +- (id)getTripForId:(NSString *)identifier completion:(NLAutomaticCompletionBlock)completion; + +#pragma mark - User data + +- (id)getUser:(NLAutomaticCompletionBlock)completion; + +#pragma mark - Vehicle data + +- (id)getVehicles:(NLAutomaticCompletionBlock)completion; +- (id)getVehicleForId:(NSString *)identifier completion:(NLAutomaticCompletionBlock)completion; + +@end + + +@interface NSString (URLEncoding) + +- (NSString *)urlEncodeUsingEncoding:(NSStringEncoding)encoding; + +@end \ No newline at end of file diff --git a/Classes/NLAutomatic.m b/Classes/NLAutomatic.m new file mode 100644 index 0000000..de6a0f0 --- /dev/null +++ b/Classes/NLAutomatic.m @@ -0,0 +1,250 @@ +// +// NLAutomatic.m +// NLAutomatic +// +// Created by Ben Kreeger on 1/20/14. +// Copyright (c) 2014 Ben Kreeger. All rights reserved. +// + +#import "NLAutomatic.h" + +#import "NLAutomaticTrip.h" +#import "NLAutomaticUser.h" +#import "NLAutomaticVehicle.h" +#import "NLAutomaticToken.h" +#import "NLAutomaticOperation.h" +#import "AFHTTPRequestOperation+NLAutomaticOperation.h" +#import + +static NSString * const kAutomaticAPIBaseURLString = @"https://api.automatic.com/v1"; +static NSString * const kAutomaticAuthBaseURLString = @"https://accounts.automatic.com/oauth"; + +@interface NLAutomatic () + +@property (nonatomic, strong, readwrite) NSString *clientId; +@property (nonatomic, strong, readwrite) NSString *clientSecret; +@property (nonatomic, strong, readwrite) NSURL *redirectUrl; +@property (nonatomic, strong) AFHTTPRequestOperationManager *operationManager; + +@end + +@implementation NLAutomatic + +@synthesize clientId = _clientId; +@synthesize clientSecret = _clientSecret; +@synthesize redirectUrl = _redirectUrl; + +#pragma mark - Lifecycle + +- (instancetype)initWithClientId:(NSString *)clientId + clientSecret:(NSString *)clientSecret + redirectUrl:(NSURL *)redirectUrl { + return [self initWithClientId:clientId clientSecret:clientSecret redirectUrl:redirectUrl token:nil]; +} + +- (instancetype)initWithClientId:(NSString *)clientId + clientSecret:(NSString *)clientSecret + redirectUrl:(NSURL *)redirectUrl + token:(NLAutomaticToken *)token { + self = [super init]; + if (self) + { + _operationManager = [[AFHTTPRequestOperationManager alloc] initWithBaseURL:[NSURL URLWithString:kAutomaticAPIBaseURLString]]; + _clientId = clientId; + _clientSecret = clientSecret; + _redirectUrl = redirectUrl; + [self setToken:token]; + } + + return self; +} + +#pragma mark - Properties + +- (void)setToken:(NLAutomaticToken *)token { + _token = token; + NSString *value = token ? [NSString stringWithFormat:@"token %@", token.accessToken] : @""; + [self.operationManager.requestSerializer setValue:value forHTTPHeaderField:@"Authorization"]; +} + +#pragma mark - Authentication and authorization + +- (NSURLRequest *)authenticationRequestForAllScopes { + NSArray *scopes = @[NLAutomaticScopePublic, + NLAutomaticScopeUserProfile, + NLAutomaticScopeUserFollow, + NLAutomaticScopeLocation, + NLAutomaticScopeCurrentLocation, + NLAutomaticScopeVehicleProfile, + NLAutomaticScopeVehicleEvents, + NLAutomaticScopeVehicleVIN, + NLAutomaticScopeTrip, + NLAutomaticScopeBehavior, + NLAutomaticScopeAdapterBasic + ]; + return [self authenticationRequestForScopes:scopes]; +} + +- (NSURLRequest *)authenticationRequestForStandardScopes +{ + NSArray *scopes = @[NLAutomaticScopePublic, + NLAutomaticScopeUserProfile, + NLAutomaticScopeLocation, + NLAutomaticScopeVehicleProfile, + NLAutomaticScopeVehicleEvents, + NLAutomaticScopeTrip, + NLAutomaticScopeBehavior, + ]; + return [self authenticationRequestForScopes:scopes]; +} + +- (NSURLRequest *)authenticationRequestForScopes:(NSArray *)scopes { + NSDictionary *params = @{@"client_id": self.clientId, + @"scope": [scopes componentsJoinedByString:@" "], + @"response_type": @"code"}; + NSMutableArray *components = [NSMutableArray array]; + [params enumerateKeysAndObjectsUsingBlock:^(NSString *key, NSString *value, BOOL *stop) { + key = [key urlEncodeUsingEncoding:NSUTF8StringEncoding]; + value = [value urlEncodeUsingEncoding:NSUTF8StringEncoding]; + [components addObject:[NSString stringWithFormat:@"%@=%@", key, value]]; + }]; + NSString *joinedParams = [components componentsJoinedByString:@"&"]; + NSString *baseURL = [NSString stringWithFormat:@"%@/%@", kAutomaticAuthBaseURLString, @"authorize"]; + NSString *fullUrl = [NSString stringWithFormat:@"%@?%@", baseURL, joinedParams]; + NSLog(@"Generated URL %@", fullUrl); + NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:fullUrl]]; + return request; +} + +- (void)getAccessTokenForCode:(NSString *)code completion:(NLAutomaticTokenCompletionBlock)completion { + NSString *url = [NSString stringWithFormat:@"%@/%@", kAutomaticAuthBaseURLString, @"access_token"]; + NSDictionary *params = @{@"client_id": self.clientId, + @"client_secret": self.clientSecret, + @"code": code, + @"grant_type": @"authorization_code"}; + [self.operationManager POST:url parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) { + self.token = [NLAutomaticToken tokenWithDictionary:responseObject]; + if (completion) { + completion(nil, self.token); + } + } failure:^(AFHTTPRequestOperation *operation, NSError *error) { + if (completion) { + completion(error, nil); + } + }]; +} + +#pragma mark - Trip data + +- (id)getTrips:(NLAutomaticCompletionBlock)completion { + NSString *url = @"trips"; + NSDictionary *params = @{}; + id automaticOp = [self.operationManager GET:url parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) { + NSMutableArray *mResults = [NSMutableArray array]; + [responseObject enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { + [mResults addObject:[[NLAutomaticTrip alloc] initWithAPIObject:obj]]; + }]; + if (completion) { + completion(nil, [mResults copy]); + } + } failure:^(AFHTTPRequestOperation *operation, NSError *error) { + if (completion) { + completion(error, operation.responseObject); + } + }]; + + return automaticOp; +} + +- (id)getTripForId:(NSString *)identifier completion:(NLAutomaticCompletionBlock)completion +{ + NSString *url = [NSString stringWithFormat:@"%@/%@", @"trips", identifier]; + NSDictionary *params = @{}; + id automaticOp = [self.operationManager GET:url parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) { + NLAutomaticTrip *trip = [[NLAutomaticTrip alloc] initWithAPIObject:responseObject]; + if (completion) { + completion(nil, trip); + } + } failure:^(AFHTTPRequestOperation *operation, NSError *error) { + if (completion) { + completion(error, operation.responseObject); + } + }]; + + return automaticOp; +} + +#pragma mark - User data + +- (id)getUser:(NLAutomaticCompletionBlock)completion +{ + NSString *url = @"user"; + NSDictionary *params = @{}; + id automaticOp = [self.operationManager GET:url parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) { + NLAutomaticUser *user = [[NLAutomaticUser alloc] initWithAPIObject:responseObject]; + if (completion) { + completion(nil, user); + } + } failure:^(AFHTTPRequestOperation *operation, NSError *error) { + if (completion) { + completion(error, operation.responseObject); + } + }]; + + return automaticOp; +} + +#pragma mark - Vehicle data + +- (id)getVehicles:(NLAutomaticCompletionBlock)completion +{ + NSString *url = @"vehicles"; + NSDictionary *params = @{}; + id automaticOp = [self.operationManager GET:url parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) { + NSMutableArray *mResults = [NSMutableArray array]; + [responseObject enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { + [mResults addObject:[[NLAutomaticVehicle alloc] initWithAPIObject:obj]]; + }]; + if (completion) { + completion(nil, [mResults copy]); + } + } failure:^(AFHTTPRequestOperation *operation, NSError *error) { + if (completion) { + completion(error, operation.responseObject); + } + }]; + + return automaticOp; +} + +- (id)getVehicleForId:(NSString *)identifier completion:(NLAutomaticCompletionBlock)completion +{ + NSString *url = [NSString stringWithFormat:@"%@/%@", @"vehicles", identifier]; + NSDictionary *params = @{}; + id automaticOp = [self.operationManager GET:url parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) { + NLAutomaticVehicle *vehicle = [[NLAutomaticVehicle alloc] initWithAPIObject:responseObject]; + if (completion) { + completion(nil, vehicle); + } + } failure:^(AFHTTPRequestOperation *operation, NSError *error) { + if (completion) { + completion(error, operation.responseObject); + } + }]; + + return automaticOp; +} + +@end + + +@implementation NSString (URLEncoding) + +- (NSString *)urlEncodeUsingEncoding:(NSStringEncoding)encoding { + CFStringRef toEncode = (CFStringRef)@"!*'\"();@&=$,/?%#[]% "; + CFStringEncoding cEncoding = CFStringConvertNSStringEncodingToEncoding(encoding); + CFStringRef stringRef = CFURLCreateStringByAddingPercentEscapes(NULL, (CFStringRef)self, NULL, toEncode, cEncoding); + return (NSString *)CFBridgingRelease(stringRef); +} + +@end \ No newline at end of file diff --git a/Classes/BDKAutomaticObject.h b/Classes/NLAutomaticObject.h similarity index 79% rename from Classes/BDKAutomaticObject.h rename to Classes/NLAutomaticObject.h index 652446f..ad9587f 100644 --- a/Classes/BDKAutomaticObject.h +++ b/Classes/NLAutomaticObject.h @@ -1,5 +1,5 @@ // -// BDKAutomaticObject.h +// NLAutomaticObject.h // Pods // // Created by Ben Kreeger on 2/4/14. @@ -8,7 +8,7 @@ @import Foundation; -@interface BDKAutomaticObject : NSObject +@interface NLAutomaticObject : NSObject + (NSDictionary *)attributeMap; diff --git a/Classes/BDKAutomaticObject.m b/Classes/NLAutomaticObject.m similarity index 91% rename from Classes/BDKAutomaticObject.m rename to Classes/NLAutomaticObject.m index 6cfddf8..74e4f4a 100644 --- a/Classes/BDKAutomaticObject.m +++ b/Classes/NLAutomaticObject.m @@ -1,16 +1,16 @@ // -// BDKAutomaticObject.m +// NLAutomaticObject.m // Pods // // Created by Ben Kreeger on 2/4/14. // // -#import "BDKAutomaticObject.h" +#import "NLAutomaticObject.h" #import -@implementation BDKAutomaticObject +@implementation NLAutomaticObject #pragma mark - Class methods @@ -33,7 +33,7 @@ - (void)updateWithAPIObject:(NSDictionary *)apiObject { id remoteValue = [apiObject valueForKey:value[@"key"]]; if (value[@"type"]) { Class remoteClass = NSClassFromString(value[@"type"]); - if ([remoteClass isSubclassOfClass:[BDKAutomaticObject class]]) { + if ([remoteClass isSubclassOfClass:[NLAutomaticObject class]]) { id instanceOfRemoteClass = [[remoteClass alloc] initWithAPIObject:remoteValue]; [self setValue:instanceOfRemoteClass forKey:localName]; } @@ -48,7 +48,7 @@ - (void)updateWithAPIObject:(NSDictionary *)apiObject { } } } - id remoteValue = [apiObject valueForKey:value]; + id remoteValue = [apiObject valueForKeyPath:value]; if (remoteValue && ![remoteValue isEqual:[NSNull null]]) { [self setValue:remoteValue forKey:localName]; } diff --git a/Classes/NLAutomaticOperation.h b/Classes/NLAutomaticOperation.h new file mode 100644 index 0000000..7f13a80 --- /dev/null +++ b/Classes/NLAutomaticOperation.h @@ -0,0 +1,17 @@ +// +// NLAutomaticOperation.h +// Pods +// +// Created by Nelson LeDuc on 4/6/15. +// +// + +#import + +@protocol NLAutomaticOperation + +- (void)cancelAutomaticOperation; +- (void)pauseAutomaticOperation; +- (void)resumeAutomaticOperation; + +@end diff --git a/Classes/NLAutomaticScopes.h b/Classes/NLAutomaticScopes.h new file mode 100644 index 0000000..6c2b3d9 --- /dev/null +++ b/Classes/NLAutomaticScopes.h @@ -0,0 +1,21 @@ +// +// NLAutomaticScopes.h +// Pods +// +// Created by Ben Kreeger on 2/2/14. +// Copyright (c) 2014 Ben Kreeger. All rights reserved. +// + +@import Foundation; + +extern NSString * const NLAutomaticScopePublic; +extern NSString * const NLAutomaticScopeUserProfile; +extern NSString * const NLAutomaticScopeUserFollow; +extern NSString * const NLAutomaticScopeLocation; +extern NSString * const NLAutomaticScopeCurrentLocation; +extern NSString * const NLAutomaticScopeVehicleProfile; +extern NSString * const NLAutomaticScopeVehicleEvents; +extern NSString * const NLAutomaticScopeVehicleVIN; +extern NSString * const NLAutomaticScopeTrip; +extern NSString * const NLAutomaticScopeBehavior; +extern NSString * const NLAutomaticScopeAdapterBasic; diff --git a/Classes/NLAutomaticScopes.m b/Classes/NLAutomaticScopes.m new file mode 100644 index 0000000..1b0aa8d --- /dev/null +++ b/Classes/NLAutomaticScopes.m @@ -0,0 +1,21 @@ +// +// NLAutomaticScopes.m +// Pods +// +// Created by Ben Kreeger on 2/2/14. +// Copyright (c) 2014 Ben Kreeger. All rights reserved. +// + +#import "NLAutomaticScopes.h" + +NSString * const NLAutomaticScopePublic = @"scope:public"; +NSString * const NLAutomaticScopeUserProfile = @"scope:user:profile"; +NSString * const NLAutomaticScopeUserFollow = @"scope:user:follow"; +NSString * const NLAutomaticScopeLocation = @"scope:location"; +NSString * const NLAutomaticScopeCurrentLocation = @"scope:current_location"; +NSString * const NLAutomaticScopeVehicleProfile = @"scope:vehicle:profile"; +NSString * const NLAutomaticScopeVehicleEvents = @"scope:vehicle:events"; +NSString * const NLAutomaticScopeVehicleVIN = @"scope:vehicle:vin"; +NSString * const NLAutomaticScopeTrip = @"scope:trip"; +NSString * const NLAutomaticScopeBehavior = @"scope:behavior"; +NSString * const NLAutomaticScopeAdapterBasic = @"scope:adapter:basic"; diff --git a/Classes/BDKAutomaticTerminus.h b/Classes/NLAutomaticTerminus.h similarity index 71% rename from Classes/BDKAutomaticTerminus.h rename to Classes/NLAutomaticTerminus.h index 8b105a4..4b8a46f 100644 --- a/Classes/BDKAutomaticTerminus.h +++ b/Classes/NLAutomaticTerminus.h @@ -1,14 +1,14 @@ // -// BDKAutomaticTerminus.h +// NLAutomaticTerminus.h // Pods // // Created by Ben Kreeger on 2/4/14. // // -#import "BDKAutomaticObject.h" +#import "NLAutomaticObject.h" -@interface BDKAutomaticTerminus : BDKAutomaticObject +@interface NLAutomaticTerminus : NLAutomaticObject @property (strong, nonatomic) NSNumber *accuracyInMeters; @property (strong, nonatomic) NSNumber *latitude; diff --git a/Classes/BDKAutomaticTerminus.m b/Classes/NLAutomaticTerminus.m similarity index 79% rename from Classes/BDKAutomaticTerminus.m rename to Classes/NLAutomaticTerminus.m index a53bce6..f1f7d6e 100644 --- a/Classes/BDKAutomaticTerminus.m +++ b/Classes/NLAutomaticTerminus.m @@ -1,16 +1,16 @@ // -// BDKAutomaticTerminus.m +// NLAutomaticTerminus.m // Pods // // Created by Ben Kreeger on 2/4/14. // // -#import "BDKAutomaticTerminus.h" +#import "NLAutomaticTerminus.h" -@implementation BDKAutomaticTerminus +@implementation NLAutomaticTerminus -#pragma mark - BDKAutomaticObject +#pragma mark - NLAutomaticObject + (NSDictionary *)attributeMap { return @{@"accuracyInMeters": @"accuracy_m", diff --git a/Classes/BDKAutomaticToken.h b/Classes/NLAutomaticToken.h similarity index 86% rename from Classes/BDKAutomaticToken.h rename to Classes/NLAutomaticToken.h index 62d5657..1867c0f 100644 --- a/Classes/BDKAutomaticToken.h +++ b/Classes/NLAutomaticToken.h @@ -1,5 +1,5 @@ // -// BDKAutomaticToken.h +// NLAutomaticToken.h // Pods // // Created by Ben Kreeger on 2/2/14. @@ -8,7 +8,7 @@ #import -@interface BDKAutomaticToken : NSObject +@interface NLAutomaticToken : NSObject @property (strong, nonatomic) NSString *accessToken; @property (strong, nonatomic) NSDate *expiresAt; diff --git a/Classes/BDKAutomaticToken.m b/Classes/NLAutomaticToken.m similarity index 94% rename from Classes/BDKAutomaticToken.m rename to Classes/NLAutomaticToken.m index 208cda5..35c2cd6 100644 --- a/Classes/BDKAutomaticToken.m +++ b/Classes/NLAutomaticToken.m @@ -1,20 +1,20 @@ // -// BDKAutomaticToken.m +// NLAutomaticToken.m // Pods // // Created by Ben Kreeger on 2/2/14. // // -#import "BDKAutomaticToken.h" +#import "NLAutomaticToken.h" -@interface BDKAutomaticToken () +@interface NLAutomaticToken () - (instancetype)initWithDictionary:(NSDictionary *)dictionary; @end -@implementation BDKAutomaticToken +@implementation NLAutomaticToken #pragma mark - Lifecycle diff --git a/Classes/BDKAutomaticTrip.h b/Classes/NLAutomaticTrip.h similarity index 70% rename from Classes/BDKAutomaticTrip.h rename to Classes/NLAutomaticTrip.h index 8962c7b..6e129e5 100644 --- a/Classes/BDKAutomaticTrip.h +++ b/Classes/NLAutomaticTrip.h @@ -1,23 +1,23 @@ // -// BDKAutomaticTrip.h +// NLAutomaticTrip.h // Pods // // Created by Ben Kreeger on 2/4/14. // // -#import "BDKAutomaticObject.h" +#import "NLAutomaticObject.h" -@class BDKAutomaticTerminus, BDKAutomaticVehicle; +@class NLAutomaticTerminus, NLAutomaticVehicle; -@interface BDKAutomaticTrip : BDKAutomaticObject +@interface NLAutomaticTrip : NLAutomaticObject @property (strong, nonatomic) NSNumber *averageMpg; @property (strong, nonatomic) NSNumber *distanceInMeters; @property (strong, nonatomic) NSNumber *durationOver70MPH; @property (strong, nonatomic) NSNumber *durationOver75MPH; @property (strong, nonatomic) NSNumber *durationOver80MPH; -@property (strong, nonatomic) BDKAutomaticTerminus *endLocation; +@property (strong, nonatomic) NLAutomaticTerminus *endLocation; @property (strong, nonatomic) NSDate *endTime; @property (strong, nonatomic) NSString *endTimeZone; @property (strong, nonatomic) NSNumber *fuelCostInUSD; @@ -26,11 +26,11 @@ @property (strong, nonatomic) NSNumber *hardBrakes; @property (strong, nonatomic) NSString *identifier; @property (strong, nonatomic) NSString *path; -@property (strong, nonatomic) BDKAutomaticTerminus *startLocation; +@property (strong, nonatomic) NLAutomaticTerminus *startLocation; @property (strong, nonatomic) NSDate *startTime; @property (strong, nonatomic) NSString *startTimeZone; @property (strong, nonatomic) NSURL *uri; -@property (strong, nonatomic) NSNumber *userId; -@property (strong, nonatomic) BDKAutomaticVehicle *vehicle; +@property (strong, nonatomic) NSString *userId; +@property (strong, nonatomic) NLAutomaticVehicle *vehicle; @end diff --git a/Classes/BDKAutomaticTrip.m b/Classes/NLAutomaticTrip.m similarity index 81% rename from Classes/BDKAutomaticTrip.m rename to Classes/NLAutomaticTrip.m index af99823..e556a90 100644 --- a/Classes/BDKAutomaticTrip.m +++ b/Classes/NLAutomaticTrip.m @@ -1,16 +1,16 @@ // -// BDKAutomaticTrip.m +// NLAutomaticTrip.m // Pods // // Created by Ben Kreeger on 2/4/14. // // -#import "BDKAutomaticTrip.h" +#import "NLAutomaticTrip.h" -@implementation BDKAutomaticTrip +@implementation NLAutomaticTrip -#pragma mark - BDKAutomaticObject +#pragma mark - NLAutomaticObject + (NSDictionary *)attributeMap { return @{@"averageMpg": @"average_mpg", @@ -18,7 +18,7 @@ + (NSDictionary *)attributeMap { @"durationOver70MPH": @"duration_over_70_s", @"durationOver75MPH": @"duration_over_75_s", @"durationOver80MPH": @"duration_over_80_s", - @"endLocation": @{@"type": @"BDKAutomaticTerminus", + @"endLocation": @{@"type": @"NLAutomaticTerminus", @"key": @"end_location",}, @"endTime": @{@"via": @"timeInterval", @"key": @"end_time",}, @@ -29,14 +29,14 @@ + (NSDictionary *)attributeMap { @"hardBrakes": @"hard_brakes", @"identifier": @"id", @"path": @"path", - @"startLocation": @{@"type": @"BDKAutomaticTerminus", + @"startLocation": @{@"type": @"NLAutomaticTerminus", @"key": @"start_location",}, @"startTime": @{@"via": @"timeInterval", @"key": @"start_time",}, @"startTimeZone": @"start_time_zone", @"uri": @"uri", @"userId": @"user.id", - @"vehicle": @{@"type": @"BDKAutomaticVehicle", + @"vehicle": @{@"type": @"NLAutomaticVehicle", @"key": @"vehicle",}, }; } diff --git a/Classes/NLAutomaticUser.h b/Classes/NLAutomaticUser.h new file mode 100644 index 0000000..ce74383 --- /dev/null +++ b/Classes/NLAutomaticUser.h @@ -0,0 +1,18 @@ +// +// NLAutomaticUser.h +// Pods +// +// Created by Nelson LeDuc on 4/1/15. +// +// + +#import "NLAutomaticObject.h" + +@interface NLAutomaticUser : NLAutomaticObject + +@property (nonatomic, strong) NSString *identifier; +@property (nonatomic, strong) NSString *firstName; +@property (nonatomic, strong) NSString *lastName; +@property (nonatomic, strong) NSString *email; + +@end diff --git a/Classes/NLAutomaticUser.m b/Classes/NLAutomaticUser.m new file mode 100644 index 0000000..a90884c --- /dev/null +++ b/Classes/NLAutomaticUser.m @@ -0,0 +1,21 @@ +// +// NLAutomaticUser.m +// Pods +// +// Created by Nelson LeDuc on 4/1/15. +// +// + +#import "NLAutomaticUser.h" + +@implementation NLAutomaticUser + ++ (NSDictionary *)attributeMap { + return @{@"identifier": @"id", + @"firstName": @"first_name", + @"lastName": @"last_name", + @"email": @"email" + }; +} + +@end diff --git a/Classes/BDKAutomaticVehicle.h b/Classes/NLAutomaticVehicle.h similarity index 61% rename from Classes/BDKAutomaticVehicle.h rename to Classes/NLAutomaticVehicle.h index 4d57f02..12dd0a2 100644 --- a/Classes/BDKAutomaticVehicle.h +++ b/Classes/NLAutomaticVehicle.h @@ -1,19 +1,21 @@ // -// BDKAutomaticVehicle.h +// NLAutomaticVehicle.h // Pods // // Created by Ben Kreeger on 2/4/14. // // -#import "BDKAutomaticObject.h" +#import "NLAutomaticObject.h" -@interface BDKAutomaticVehicle : BDKAutomaticObject +@interface NLAutomaticVehicle : NLAutomaticObject @property (strong, nonatomic) NSString *displayName; @property (strong, nonatomic) NSNumber *identifier; @property (strong, nonatomic) NSString *make; @property (strong, nonatomic) NSString *model; @property (strong, nonatomic) NSNumber *year; +@property (strong, nonatomic) NSURL *uri; +@property (strong, nonatomic) NSString *color; @end diff --git a/Classes/BDKAutomaticVehicle.m b/Classes/NLAutomaticVehicle.m similarity index 74% rename from Classes/BDKAutomaticVehicle.m rename to Classes/NLAutomaticVehicle.m index 79166af..179370c 100644 --- a/Classes/BDKAutomaticVehicle.m +++ b/Classes/NLAutomaticVehicle.m @@ -1,16 +1,16 @@ // -// BDKAutomaticVehicle.m +// NLAutomaticVehicle.m // Pods // // Created by Ben Kreeger on 2/4/14. // // -#import "BDKAutomaticVehicle.h" +#import "NLAutomaticVehicle.h" -@implementation BDKAutomaticVehicle +@implementation NLAutomaticVehicle -#pragma mark - BDKAutomaticObject +#pragma mark - NLAutomaticObject + (NSDictionary *)attributeMap { return @{@"displayName": @"display_name", @@ -18,6 +18,8 @@ + (NSDictionary *)attributeMap { @"make": @"make", @"model": @"model", @"year": @"year", + @"uri": @"uri", + @"color": @"color" }; } diff --git a/Classes/Promise/NLAutomatic+Promise.h b/Classes/Promise/NLAutomatic+Promise.h new file mode 100644 index 0000000..0a18446 --- /dev/null +++ b/Classes/Promise/NLAutomatic+Promise.h @@ -0,0 +1,29 @@ +// +// NLAutomatic+Promise.h +// Pods +// +// Created by Nelson LeDuc on 4/1/15. +// +// + +#import "NLAutomatic.h" + +@class PMKPromise; + +@interface NLAutomatic (Promise) + +#pragma mark - Trip data + +- (PMKPromise *)getTrips; +- (PMKPromise *)getTripForId:(NSString *)identifier; + +#pragma mark - User data + +- (PMKPromise *)getUser; + +#pragma mark - Vehicle data + +- (PMKPromise *)getVehicles; +- (PMKPromise *)getVehicleForId:(NSString *)identifier; + +@end diff --git a/Classes/Promise/NLAutomatic+Promise.m b/Classes/Promise/NLAutomatic+Promise.m new file mode 100644 index 0000000..1b6ee85 --- /dev/null +++ b/Classes/Promise/NLAutomatic+Promise.m @@ -0,0 +1,66 @@ +// +// NLAutomatic+Promise.m +// Pods +// +// Created by Nelson LeDuc on 4/1/15. +// +// + +#import "NLAutomatic+Promise.h" + +#import + +@implementation NLAutomatic (Promise) + +#pragma mark - Trip data + +- (PMKPromise *)getTrips +{ + return [PMKPromise promiseWithResolver:^(PMKResolver resolve) { + [self getTrips:^(NSError *error, id responseObject) { + resolve(responseObject ?: error); + }]; + }]; +} + +- (PMKPromise *)getTripForId:(NSString *)identifier +{ + return [PMKPromise promiseWithResolver:^(PMKResolver resolve) { + [self getTripForId:identifier completion:^(NSError *error, id responseObject) { + resolve(responseObject ?: error); + }]; + }]; +} + +#pragma mark - User data + +- (PMKPromise *)getUser +{ + return [PMKPromise promiseWithResolver:^(PMKResolver resolve) { + [self getUser:^(NSError *error, id responseObject) { + resolve(responseObject ?: error); + }]; + }]; +} + +#pragma mark - Vehicle data + +- (PMKPromise *)getVehicles +{ + return [PMKPromise promiseWithResolver:^(PMKResolver resolve) { + [self getVehicles:^(NSError *error, id responseObject) { + resolve(responseObject ?: error); + }]; + }]; +} + +- (PMKPromise *)getVehicleForId:(NSString *)identifier +{ + return [PMKPromise promiseWithResolver:^(PMKResolver resolve) { + [self getVehicleForId:identifier completion:^(NSError *error, id responseObject) { + resolve(responseObject ?: error); + }]; + }]; +} + +@end diff --git a/NLAutomatic.podspec b/NLAutomatic.podspec new file mode 100644 index 0000000..0769c0b --- /dev/null +++ b/NLAutomatic.podspec @@ -0,0 +1,29 @@ +Pod::Spec.new do |s| + s.name = "NLAutomatic" + s.version = "0.1.0" + s.summary = "A framework for talking to the Automatic API." + s.homepage = "https://github.com/nelsonleduc/NLAutomatic" + s.license = 'MIT' + s.author = { "Nelson LeDuc" => "nelson.leduc@jumpspaceapps.com" } + s.source = { :git => "https://github.com/nelsonleduc/NLAutomatic.git", :tag => "#{s.version}" } + + s.ios.deployment_target = '7.0' + s.osx.deployment_target = '10.8' + s.requires_arc = true + + s.subspec 'Adapter' do |sub| + sub.source_files = 'Classes/*.{h,m}' + sub.dependency 'AFNetworking/NSURLConnection', '~> 2.0' + end + + s.subspec 'MKPolyline' do |sub| + sub.source_files = 'Classes/MapKit/*.{h,m}' + sub.frameworks = 'MapKit' + end + + s.subspec 'Promise' do |sub| + sub.source_files = 'Classes/Promise/*.{h,m}' + sub.dependency 'NLAutomatic/Adapter' + sub.dependency 'PromiseKit/Promise' + end +end diff --git a/Project/BDKAutomatic.xcworkspace/contents.xcworkspacedata b/Project/BDKAutomatic.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 54a9af6..0000000 --- a/Project/BDKAutomatic.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Project/BDKAutomatic.xcworkspace/xcshareddata/BDKAutomatic.xccheckout b/Project/BDKAutomatic.xcworkspace/xcshareddata/BDKAutomatic.xccheckout deleted file mode 100644 index c1d5ca6..0000000 --- a/Project/BDKAutomatic.xcworkspace/xcshareddata/BDKAutomatic.xccheckout +++ /dev/null @@ -1,41 +0,0 @@ - - - - - IDESourceControlProjectFavoriteDictionaryKey - - IDESourceControlProjectIdentifier - BD12A5E5-5D5A-4CFE-A6E4-762BB892EBD2 - IDESourceControlProjectName - BDKAutomatic - IDESourceControlProjectOriginsDictionary - - F4EF800C-BF02-422C-A4FE-BCDB47669C37 - ssh://github.com/kreeger/BDKAutomatic.git - - IDESourceControlProjectPath - Project/BDKAutomatic.xcworkspace - IDESourceControlProjectRelativeInstallPathDictionary - - F4EF800C-BF02-422C-A4FE-BCDB47669C37 - ../.. - - IDESourceControlProjectURL - ssh://github.com/kreeger/BDKAutomatic.git - IDESourceControlProjectVersion - 110 - IDESourceControlProjectWCCIdentifier - F4EF800C-BF02-422C-A4FE-BCDB47669C37 - IDESourceControlProjectWCConfigurations - - - IDESourceControlRepositoryExtensionIdentifierKey - public.vcs.git - IDESourceControlWCCIdentifierKey - F4EF800C-BF02-422C-A4FE-BCDB47669C37 - IDESourceControlWCCName - BDKAutomatic - - - - diff --git a/Project/Classes/BDKAuthViewController.h b/Project/Classes/BDKAuthViewController.h deleted file mode 100644 index 2d5cf30..0000000 --- a/Project/Classes/BDKAuthViewController.h +++ /dev/null @@ -1,20 +0,0 @@ -// -// BDKAuthViewController.h -// BDKAutomatic -// -// Created by Ben Kreeger on 2/2/14. -// Copyright (c) 2014 Ben Kreeger. All rights reserved. -// - -@import UIKit; - -@class BDKAutomatic, BDKAutomaticToken; - -@interface BDKAuthViewController : UIViewController - -@property (readonly, nonatomic) BDKAutomatic *automatic; -@property (copy, nonatomic) void (^userAuthenticated)(BDKAutomaticToken *token); - -+ (instancetype)viewControllerWithAutomaticAdapter:(BDKAutomatic *)adapter; - -@end diff --git a/Project/Classes/BDKAutomaticSecrets.plist.example b/Project/Classes/BDKAutomaticSecrets.plist.example deleted file mode 100644 index 49159d0..0000000 --- a/Project/Classes/BDKAutomaticSecrets.plist.example +++ /dev/null @@ -1,12 +0,0 @@ - - - - - BDKAutomaticClientId - - BDKAutomaticClientSecret - - BDKAutomaticRedirectUrl - - - diff --git a/Project/Classes/BDKMapViewController.h b/Project/Classes/BDKMapViewController.h deleted file mode 100644 index 8c6eea9..0000000 --- a/Project/Classes/BDKMapViewController.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// BDKMapViewController.h -// BDKAutomatic -// -// Created by Ben Kreeger on 2/4/14. -// Copyright (c) 2014 Ben Kreeger. All rights reserved. -// - -@class BDKAutomaticTrip; - -@interface BDKMapViewController : UIViewController - -@property (strong, nonatomic) BDKAutomaticTrip *trip; - -@end diff --git a/Project/Classes/Info.plist b/Project/Classes/Info.plist index b237af6..2261168 100644 --- a/Project/Classes/Info.plist +++ b/Project/Classes/Info.plist @@ -9,7 +9,7 @@ CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier - gr.kree.${PRODUCT_NAME:rfc1034identifier} + com.nelsonleduc.$(PRODUCT_NAME:rfc1034identifier) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/Project/Classes/BDKAppDelegate.h b/Project/Classes/NLAppDelegate.h similarity index 51% rename from Project/Classes/BDKAppDelegate.h rename to Project/Classes/NLAppDelegate.h index 07a289f..481056c 100644 --- a/Project/Classes/BDKAppDelegate.h +++ b/Project/Classes/NLAppDelegate.h @@ -1,6 +1,6 @@ // -// BDKAppDelegate.h -// BDKAutomatic +// NLAppDelegate.h +// NLAutomatic // // Created by Ben Kreeger on 1/20/14. // Copyright (c) 2014 Ben Kreeger. All rights reserved. @@ -8,11 +8,11 @@ @import UIKit; -@class BDKAutomatic; +@class NLAutomatic; -@interface BDKAppDelegate : UIResponder +@interface NLAppDelegate : UIResponder @property (strong, nonatomic) UIWindow *window; -@property (readonly) BDKAutomatic *automatic; +@property (readonly) NLAutomatic *automatic; @end diff --git a/Project/Classes/BDKAppDelegate.m b/Project/Classes/NLAppDelegate.m similarity index 61% rename from Project/Classes/BDKAppDelegate.m rename to Project/Classes/NLAppDelegate.m index 423100d..9c2eae4 100644 --- a/Project/Classes/BDKAppDelegate.m +++ b/Project/Classes/NLAppDelegate.m @@ -1,24 +1,24 @@ // -// BDKAppDelegate.m -// BDKAutomatic +// NLAppDelegate.m +// NLAutomatic // // Created by Ben Kreeger on 1/20/14. // Copyright (c) 2014 Ben Kreeger. All rights reserved. // -#import "BDKAppDelegate.h" -#import "BDKAuthViewController.h" -#import "BDKTableViewController.h" +#import "NLAppDelegate.h" +#import "NLAuthViewController.h" +#import "NLTableViewController.h" -#import +#import -@interface BDKAppDelegate () +@interface NLAppDelegate () - (void)setupAutomaticAPI; @end -@implementation BDKAppDelegate +@implementation NLAppDelegate @synthesize automatic = _automatic; @@ -35,33 +35,33 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( } - (void)setupAutomaticAPI { - NSString *path = [[NSBundle mainBundle] pathForResource:@"BDKAutomaticSecrets" ofType:@"plist"]; - NSAssert(path, @"You must copy BDKAutomaticSecrets.plist.example to BDKAutomaticSecrets.plist and fill out your\ + NSString *path = [[NSBundle mainBundle] pathForResource:@"NLAutomaticSecrets" ofType:@"plist"]; + NSAssert(path, @"You must copy NLAutomaticSecrets.plist.example to NLAutomaticSecrets.plist and fill out your\ information."); NSDictionary *secrets = [NSDictionary dictionaryWithContentsOfFile:path]; - NSString *clientId = secrets[@"BDKAutomaticClientId"]; - NSAssert(clientId, @"Must fill in Automatic API Client ID in BDKAutomaticSecrets.plist."); - NSString *clientSecret = secrets[@"BDKAutomaticClientSecret"]; - NSAssert(clientSecret, @"Must fill in Automatic API Client Secret in BDKAutomaticSecrets.plist."); - NSString *redirectUrlString = secrets[@"BDKAutomaticRedirectUrl"]; - NSAssert(redirectUrlString, @"Must fill in Automatic API Redirect URL in BDKAutomaticSecrets.plist."); + NSString *clientId = secrets[@"NLAutomaticClientId"]; + NSAssert(clientId, @"Must fill in Automatic API Client ID in NLAutomaticSecrets.plist."); + NSString *clientSecret = secrets[@"NLAutomaticClientSecret"]; + NSAssert(clientSecret, @"Must fill in Automatic API Client Secret in NLAutomaticSecrets.plist."); + NSString *redirectUrlString = secrets[@"NLAutomaticRedirectUrl"]; + NSAssert(redirectUrlString, @"Must fill in Automatic API Redirect URL in NLAutomaticSecrets.plist."); NSURL *redirectUrl = [NSURL URLWithString:redirectUrlString]; - _automatic = [[BDKAutomatic alloc] initWithClientId:clientId clientSecret:clientSecret redirectUrl:redirectUrl]; + _automatic = [[NLAutomatic alloc] initWithClientId:clientId clientSecret:clientSecret redirectUrl:redirectUrl]; - NSData *tokenData = [[NSUserDefaults standardUserDefaults] objectForKey:@"BDKAutomaticToken"]; + NSData *tokenData = [[NSUserDefaults standardUserDefaults] objectForKey:@"NLAutomaticToken"]; if (tokenData) { - BDKAutomaticToken *token = [NSKeyedUnarchiver unarchiveObjectWithData:tokenData]; + NLAutomaticToken *token = [NSKeyedUnarchiver unarchiveObjectWithData:tokenData]; _automatic.token = token; } } - (void)showAuthenticatedFlow { - BDKTableViewController *tableVC = [BDKTableViewController viewControllerWithAutomaticAdapter:self.automatic]; + NLTableViewController *tableVC = [NLTableViewController viewControllerWithAutomaticAdapter:self.automatic]; tableVC.userDidLogout = ^{ self.automatic.token = nil; - [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"BDKAutomaticToken"]; + [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"NLAutomaticToken"]; [[NSUserDefaults standardUserDefaults] synchronize]; [self showUnauthenticatedFlow]; @@ -71,11 +71,11 @@ - (void)showAuthenticatedFlow { } - (void)showUnauthenticatedFlow { - BDKAuthViewController *authVC = [BDKAuthViewController viewControllerWithAutomaticAdapter:self.automatic]; - authVC.userAuthenticated = ^(BDKAutomaticToken *token) { + NLAuthViewController *authVC = [NLAuthViewController viewControllerWithAutomaticAdapter:self.automatic]; + authVC.userAuthenticated = ^(NLAutomaticToken *token) { // Save it to defaults; in your real app, PLEASE save this data to Keychain instead. NSData *data = [NSKeyedArchiver archivedDataWithRootObject:token]; - [[NSUserDefaults standardUserDefaults] setObject:data forKey:@"BDKAutomaticToken"]; + [[NSUserDefaults standardUserDefaults] setObject:data forKey:@"NLAutomaticToken"]; [[NSUserDefaults standardUserDefaults] synchronize]; [self showAuthenticatedFlow]; diff --git a/Project/Classes/NLAuthViewController.h b/Project/Classes/NLAuthViewController.h new file mode 100644 index 0000000..c33f525 --- /dev/null +++ b/Project/Classes/NLAuthViewController.h @@ -0,0 +1,20 @@ +// +// NLAuthViewController.h +// NLAutomatic +// +// Created by Ben Kreeger on 2/2/14. +// Copyright (c) 2014 Ben Kreeger. All rights reserved. +// + +@import UIKit; + +@class NLAutomatic, NLAutomaticToken; + +@interface NLAuthViewController : UIViewController + +@property (readonly, nonatomic, weak) NLAutomatic *automatic; +@property (copy, nonatomic) void (^userAuthenticated)(NLAutomaticToken *token); + ++ (instancetype)viewControllerWithAutomaticAdapter:(NLAutomatic *)adapter; + +@end diff --git a/Project/Classes/BDKAuthViewController.m b/Project/Classes/NLAuthViewController.m similarity index 84% rename from Project/Classes/BDKAuthViewController.m rename to Project/Classes/NLAuthViewController.m index 71ba7ed..041f0ac 100644 --- a/Project/Classes/BDKAuthViewController.m +++ b/Project/Classes/NLAuthViewController.m @@ -1,27 +1,27 @@ // -// BDKAuthViewController.m -// BDKAutomatic +// NLAuthViewController.m +// NLAutomatic // // Created by Ben Kreeger on 2/2/14. // Copyright (c) 2014 Ben Kreeger. All rights reserved. // -#import "BDKAuthViewController.h" +#import "NLAuthViewController.h" -#import +#import -@interface BDKAuthViewController () +@interface NLAuthViewController () @property (strong, nonatomic) UIWebView *webView; -@property (weak, nonatomic) BDKAutomatic *automatic; +@property (weak, nonatomic) NLAutomatic *automatic; - (void)handleAutomaticAuthenticationQueryString:(NSString *)queryString; @end -@implementation BDKAuthViewController +@implementation NLAuthViewController -+ (instancetype)viewControllerWithAutomaticAdapter:(BDKAutomatic *)adapter { ++ (instancetype)viewControllerWithAutomaticAdapter:(NLAutomatic *)adapter { id instance = [self new]; [instance setAutomatic:adapter]; return instance; @@ -37,7 +37,7 @@ - (void)viewDidLoad { [super viewDidLoad]; self.title = @"Login to Automatic"; - NSURLRequest *request = [self.automatic authenticationRequestForAllScopes]; + NSURLRequest *request = [self.automatic authenticationRequestForStandardScopes]; [self.webView loadRequest:request]; } @@ -62,7 +62,7 @@ - (void)handleAutomaticAuthenticationQueryString:(NSString *)queryString { params[key] = value ?: [NSNull null]; }]; - [self.automatic getAccessTokenForCode:params[@"code"] completion:^(NSError *error, BDKAutomaticToken *token) { + [self.automatic getAccessTokenForCode:params[@"code"] completion:^(NSError *error, NLAutomaticToken *token) { if (self.userAuthenticated) { self.userAuthenticated(token); } diff --git a/Project/Classes/NLMapViewController.h b/Project/Classes/NLMapViewController.h new file mode 100644 index 0000000..ad7f474 --- /dev/null +++ b/Project/Classes/NLMapViewController.h @@ -0,0 +1,15 @@ +// +// NLMapViewController.h +// NLAutomatic +// +// Created by Ben Kreeger on 2/4/14. +// Copyright (c) 2014 Ben Kreeger. All rights reserved. +// + +@class NLAutomaticTrip; + +@interface NLMapViewController : UIViewController + +@property (strong, nonatomic) NLAutomaticTrip *trip; + +@end diff --git a/Project/Classes/BDKMapViewController.m b/Project/Classes/NLMapViewController.m similarity index 91% rename from Project/Classes/BDKMapViewController.m rename to Project/Classes/NLMapViewController.m index ff6b0f7..1b546cc 100644 --- a/Project/Classes/BDKMapViewController.m +++ b/Project/Classes/NLMapViewController.m @@ -1,19 +1,19 @@ // -// BDKMapViewController.m -// BDKAutomatic +// NLMapViewController.m +// NLAutomatic // // Created by Ben Kreeger on 2/4/14. // Copyright (c) 2014 Ben Kreeger. All rights reserved. // -#import "BDKMapViewController.h" +#import "NLMapViewController.h" @import MapKit; -#import -#import +#import +#import -@interface BDKMapViewController () +@interface NLMapViewController () @property (strong, nonatomic) MKMapView *mapView; @property (strong, nonatomic) MKPolyline *mapPath; @@ -23,7 +23,7 @@ - (void)segmentedControlChanged:(UISegmentedControl *)sender; @end -@implementation BDKMapViewController +@implementation NLMapViewController - (void)loadView { self.view = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; @@ -79,7 +79,7 @@ - (UISegmentedControl *)segmentedControl { return _segmentedControl; } -- (void)setTrip:(BDKAutomaticTrip *)trip { +- (void)setTrip:(NLAutomaticTrip *)trip { self.title = [NSString stringWithFormat:@"%@", trip.identifier]; self.mapPath = [MKPolyline polylineWithEncodedString:trip.path]; } diff --git a/Project/Classes/BDKTableViewController.h b/Project/Classes/NLTableViewController.h similarity index 50% rename from Project/Classes/BDKTableViewController.h rename to Project/Classes/NLTableViewController.h index f3dc78c..cbb2ed0 100644 --- a/Project/Classes/BDKTableViewController.h +++ b/Project/Classes/NLTableViewController.h @@ -1,6 +1,6 @@ // -// BDKTableViewController.h -// BDKAutomatic +// NLTableViewController.h +// NLAutomatic // // Created by Ben Kreeger on 2/2/14. // Copyright (c) 2014 Ben Kreeger. All rights reserved. @@ -8,14 +8,14 @@ @import UIKit; -@class BDKAutomatic; +@class NLAutomatic; -@interface BDKTableViewController : UIViewController +@interface NLTableViewController : UIViewController -@property (readonly) BDKAutomatic *automatic; +@property (readonly, weak) NLAutomatic *automatic; @property (readonly, nonatomic) UITableView *tableView; @property (copy, nonatomic) void(^userDidLogout)(void); -+ (instancetype)viewControllerWithAutomaticAdapter:(BDKAutomatic *)adapter; ++ (instancetype)viewControllerWithAutomaticAdapter:(NLAutomatic *)adapter; @end diff --git a/Project/Classes/BDKTableViewController.m b/Project/Classes/NLTableViewController.m similarity index 89% rename from Project/Classes/BDKTableViewController.m rename to Project/Classes/NLTableViewController.m index 4418a2f..132dba6 100644 --- a/Project/Classes/BDKTableViewController.m +++ b/Project/Classes/NLTableViewController.m @@ -1,24 +1,24 @@ // -// BDKTableViewController.m -// BDKAutomatic +// NLTableViewController.m +// NLAutomatic // // Created by Ben Kreeger on 2/2/14. // Copyright (c) 2014 Ben Kreeger. All rights reserved. // -#import "BDKTableViewController.h" +#import "NLTableViewController.h" -#import "BDKMapViewController.h" +#import "NLMapViewController.h" -#import -#import +#import +#import -@interface BDKTableViewController () +@interface NLTableViewController () @property (strong, nonatomic) UITableView *tableView; @property (strong, nonatomic) UIRefreshControl *refreshControl; @property (strong, nonatomic) NSDateFormatter *dateFormatter; -@property (weak, nonatomic) BDKAutomatic *automatic; +@property (weak, nonatomic) NLAutomatic *automatic; @property (strong, nonatomic) NSDictionary *tripDict; @property (strong, nonatomic) NSArray *sectionKeys; @@ -28,11 +28,11 @@ - (void)logoutButtonTapped:(UIBarButtonItem *)sender; @end -@implementation BDKTableViewController +@implementation NLTableViewController #pragma mark - Lifecycle -+ (instancetype)viewControllerWithAutomaticAdapter:(BDKAutomatic *)adapter { ++ (instancetype)viewControllerWithAutomaticAdapter:(NLAutomatic *)adapter { id instance = [self new]; [instance setAutomatic:adapter]; return instance; @@ -106,7 +106,7 @@ - (void)tableViewDidPullToRefresh:(UIRefreshControl *)control { [sectionDF setDateFormat:@"yyyy-MM-dd"]; NSDateFormatter *titleDF = [NSDateFormatter new]; [titleDF setDateFormat:@"MMMM d, yyyy"]; - [responseObject enumerateObjectsUsingBlock:^(BDKAutomaticTrip *trip, NSUInteger idx, BOOL *stop) { + [responseObject enumerateObjectsUsingBlock:^(NLAutomaticTrip *trip, NSUInteger idx, BOOL *stop) { NSString *sectionString = [sectionDF stringFromDate:trip.startTime]; [orderedKeys addObject:sectionString]; if (mTrips[sectionString]) { @@ -154,7 +154,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"Cell"]; } NSString *title = self.sectionKeys[indexPath.section]; - BDKAutomaticTrip *trip = self.tripDict[title][@"trips"][indexPath.row]; + NLAutomaticTrip *trip = self.tripDict[title][@"trips"][indexPath.row]; cell.textLabel.text = [self.dateFormatter stringFromDate:trip.startTime]; cell.textLabel.font = [UIFont systemFontOfSize:15]; cell.detailTextLabel.text = [NSString stringWithFormat:@"%.2f km", [trip.distanceInMeters floatValue] / 1000]; @@ -164,7 +164,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N #pragma mark - UITableViewDelegate - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - BDKMapViewController *mapVC = [BDKMapViewController new]; + NLMapViewController *mapVC = [NLMapViewController new]; NSString *title = self.sectionKeys[indexPath.section]; mapVC.trip = self.tripDict[title][@"trips"][indexPath.row]; [self.navigationController pushViewController:mapVC animated:YES]; diff --git a/Project/Classes/main.m b/Project/Classes/main.m index 5e27ec9..4db99d9 100644 --- a/Project/Classes/main.m +++ b/Project/Classes/main.m @@ -1,6 +1,6 @@ // // main.m -// BDKAutomatic +// NLAutomatic // // Created by Ben Kreeger on 1/20/14. // Copyright (c) 2014 Ben Kreeger. All rights reserved. @@ -8,11 +8,11 @@ #import -#import "BDKAppDelegate.h" +#import "NLAppDelegate.h" int main(int argc, char * argv[]) { @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([BDKAppDelegate class])); + return UIApplicationMain(argc, argv, nil, NSStringFromClass([NLAppDelegate class])); } } diff --git a/Project/BDKAutomatic.xcodeproj/project.pbxproj b/Project/NLAutomatic.xcodeproj/project.pbxproj similarity index 76% rename from Project/BDKAutomatic.xcodeproj/project.pbxproj rename to Project/NLAutomatic.xcodeproj/project.pbxproj index a3590e9..4e22e64 100644 --- a/Project/BDKAutomatic.xcodeproj/project.pbxproj +++ b/Project/NLAutomatic.xcodeproj/project.pbxproj @@ -15,18 +15,18 @@ B52A0D35188DED6C00C21D6C /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B52A0D34188DED6C00C21D6C /* XCTest.framework */; }; B52A0D36188DED6C00C21D6C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B52A0D1B188DED6C00C21D6C /* Foundation.framework */; }; B52A0D37188DED6C00C21D6C /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B52A0D1F188DED6C00C21D6C /* UIKit.framework */; }; - B536C109188DED9400C02470 /* BDKAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B536C102188DED9400C02470 /* BDKAppDelegate.m */; }; + B536C109188DED9400C02470 /* NLAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B536C102188DED9400C02470 /* NLAppDelegate.m */; }; B536C10B188DED9400C02470 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = B536C105188DED9400C02470 /* InfoPlist.strings */; }; B536C10C188DED9400C02470 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B536C107188DED9400C02470 /* Images.xcassets */; }; B536C10D188DED9400C02470 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = B536C108188DED9400C02470 /* main.m */; }; B536C113188DED9C00C02470 /* Specs-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = B536C10F188DED9C00C02470 /* Specs-Info.plist */; }; - B536C114188DED9C00C02470 /* BDKAutomaticTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B536C110188DED9C00C02470 /* BDKAutomaticTests.m */; }; + B536C114188DED9C00C02470 /* NLAutomaticTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B536C110188DED9C00C02470 /* NLAutomaticTests.m */; }; B536C115188DED9C00C02470 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = B536C111188DED9C00C02470 /* InfoPlist.strings */; }; B58FEB2B18A1F319009A6F62 /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B58FEB2A18A1F319009A6F62 /* MapKit.framework */; }; - B5AA05CE189ED0DA00F516D4 /* BDKAuthViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B5AA05CD189ED0DA00F516D4 /* BDKAuthViewController.m */; }; - B5AA05D8189EDC8C00F516D4 /* BDKAutomaticSecrets.plist in Resources */ = {isa = PBXBuildFile; fileRef = B5AA05D7189EDC8C00F516D4 /* BDKAutomaticSecrets.plist */; }; - B5AA05DB189EE2E700F516D4 /* BDKTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B5AA05DA189EE2E700F516D4 /* BDKTableViewController.m */; }; - B5B3F54E18A12FA00043E3CE /* BDKMapViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B5B3F54D18A12FA00043E3CE /* BDKMapViewController.m */; }; + B5AA05CE189ED0DA00F516D4 /* NLAuthViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B5AA05CD189ED0DA00F516D4 /* NLAuthViewController.m */; }; + B5AA05D8189EDC8C00F516D4 /* NLAutomaticSecrets.plist in Resources */ = {isa = PBXBuildFile; fileRef = B5AA05D7189EDC8C00F516D4 /* NLAutomaticSecrets.plist */; }; + B5AA05DB189EE2E700F516D4 /* NLTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B5AA05DA189EE2E700F516D4 /* NLTableViewController.m */; }; + B5B3F54E18A12FA00043E3CE /* NLMapViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B5B3F54D18A12FA00043E3CE /* NLMapViewController.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -41,32 +41,34 @@ /* Begin PBXFileReference section */ 02AB4A0C5C4A49C9A6CF5B50 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 5A6E3BC3E34B4B1480D24EF3 /* Pods-Specs.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Specs.xcconfig"; path = "Pods/Pods-Specs.xcconfig"; sourceTree = ""; }; - B52A0D18188DED6C00C21D6C /* BDKAutomatic.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BDKAutomatic.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 70EB720583C2358271A8F2EC /* Pods-Specs.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Specs.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Specs/Pods-Specs.debug.xcconfig"; sourceTree = ""; }; + B52A0D18188DED6C00C21D6C /* NLAutomatic.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NLAutomatic.app; sourceTree = BUILT_PRODUCTS_DIR; }; B52A0D1B188DED6C00C21D6C /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; B52A0D1D188DED6C00C21D6C /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; B52A0D1F188DED6C00C21D6C /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; B52A0D33188DED6C00C21D6C /* Specs.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Specs.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; B52A0D34188DED6C00C21D6C /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; - B536C101188DED9400C02470 /* BDKAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BDKAppDelegate.h; sourceTree = ""; }; - B536C102188DED9400C02470 /* BDKAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BDKAppDelegate.m; sourceTree = ""; }; + B536C101188DED9400C02470 /* NLAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NLAppDelegate.h; sourceTree = ""; }; + B536C102188DED9400C02470 /* NLAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NLAppDelegate.m; sourceTree = ""; }; B536C103188DED9400C02470 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; B536C104188DED9400C02470 /* Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Prefix.pch; sourceTree = ""; }; B536C106188DED9400C02470 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; B536C107188DED9400C02470 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; B536C108188DED9400C02470 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; B536C10F188DED9C00C02470 /* Specs-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Specs-Info.plist"; sourceTree = ""; }; - B536C110188DED9C00C02470 /* BDKAutomaticTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BDKAutomaticTests.m; sourceTree = ""; }; + B536C110188DED9C00C02470 /* NLAutomaticTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NLAutomaticTests.m; sourceTree = ""; }; B536C112188DED9C00C02470 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; B58FEB2A18A1F319009A6F62 /* MapKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MapKit.framework; path = System/Library/Frameworks/MapKit.framework; sourceTree = SDKROOT; }; - B5AA05CC189ED0DA00F516D4 /* BDKAuthViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BDKAuthViewController.h; sourceTree = ""; }; - B5AA05CD189ED0DA00F516D4 /* BDKAuthViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BDKAuthViewController.m; sourceTree = ""; }; - B5AA05D7189EDC8C00F516D4 /* BDKAutomaticSecrets.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = BDKAutomaticSecrets.plist; sourceTree = ""; }; - B5AA05D9189EE2E700F516D4 /* BDKTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BDKTableViewController.h; sourceTree = ""; }; - B5AA05DA189EE2E700F516D4 /* BDKTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BDKTableViewController.m; sourceTree = ""; }; - B5B3F54C18A12FA00043E3CE /* BDKMapViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BDKMapViewController.h; sourceTree = ""; }; - B5B3F54D18A12FA00043E3CE /* BDKMapViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BDKMapViewController.m; sourceTree = ""; }; - ED02175D452F4A59AE76AD72 /* Pods.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.xcconfig; path = Pods/Pods.xcconfig; sourceTree = ""; }; + B5AA05CC189ED0DA00F516D4 /* NLAuthViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NLAuthViewController.h; sourceTree = ""; }; + B5AA05CD189ED0DA00F516D4 /* NLAuthViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NLAuthViewController.m; sourceTree = ""; }; + B5AA05D7189EDC8C00F516D4 /* NLAutomaticSecrets.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = NLAutomaticSecrets.plist; sourceTree = ""; }; + B5AA05D9189EE2E700F516D4 /* NLTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NLTableViewController.h; sourceTree = ""; }; + B5AA05DA189EE2E700F516D4 /* NLTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NLTableViewController.m; sourceTree = ""; }; + B5B3F54C18A12FA00043E3CE /* NLMapViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NLMapViewController.h; sourceTree = ""; }; + B5B3F54D18A12FA00043E3CE /* NLMapViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NLMapViewController.m; sourceTree = ""; }; + DAA188196C9D81BE0DB0A0CB /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; + E93DE9D0A47914EF61C0E278 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; + F3F51D676EFA11B4330A349B /* Pods-Specs.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Specs.release.xcconfig"; path = "Pods/Target Support Files/Pods-Specs/Pods-Specs.release.xcconfig"; sourceTree = ""; }; FF614AE7C9B74202A6CD5D32 /* libPods-Specs.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Specs.a"; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -97,6 +99,17 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 08A565A7B3D8E0E4FA3AF060 /* Pods */ = { + isa = PBXGroup; + children = ( + E93DE9D0A47914EF61C0E278 /* Pods.debug.xcconfig */, + DAA188196C9D81BE0DB0A0CB /* Pods.release.xcconfig */, + 70EB720583C2358271A8F2EC /* Pods-Specs.debug.xcconfig */, + F3F51D676EFA11B4330A349B /* Pods-Specs.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; B52A0D0F188DED6B00C21D6C = { isa = PBXGroup; children = ( @@ -104,15 +117,14 @@ B52A0D1A188DED6C00C21D6C /* Frameworks */, B52A0D19188DED6C00C21D6C /* Products */, B536C10E188DED9C00C02470 /* Specs */, - ED02175D452F4A59AE76AD72 /* Pods.xcconfig */, - 5A6E3BC3E34B4B1480D24EF3 /* Pods-Specs.xcconfig */, + 08A565A7B3D8E0E4FA3AF060 /* Pods */, ); sourceTree = ""; }; B52A0D19188DED6C00C21D6C /* Products */ = { isa = PBXGroup; children = ( - B52A0D18188DED6C00C21D6C /* BDKAutomatic.app */, + B52A0D18188DED6C00C21D6C /* NLAutomatic.app */, B52A0D33188DED6C00C21D6C /* Specs.xctest */, ); name = Products; @@ -135,15 +147,15 @@ B536C100188DED9400C02470 /* Classes */ = { isa = PBXGroup; children = ( - B536C101188DED9400C02470 /* BDKAppDelegate.h */, - B536C102188DED9400C02470 /* BDKAppDelegate.m */, - B5AA05CC189ED0DA00F516D4 /* BDKAuthViewController.h */, - B5AA05CD189ED0DA00F516D4 /* BDKAuthViewController.m */, - B5B3F54C18A12FA00043E3CE /* BDKMapViewController.h */, - B5B3F54D18A12FA00043E3CE /* BDKMapViewController.m */, - B5AA05D9189EE2E700F516D4 /* BDKTableViewController.h */, - B5AA05DA189EE2E700F516D4 /* BDKTableViewController.m */, - B5AA05D7189EDC8C00F516D4 /* BDKAutomaticSecrets.plist */, + B536C101188DED9400C02470 /* NLAppDelegate.h */, + B536C102188DED9400C02470 /* NLAppDelegate.m */, + B5AA05CC189ED0DA00F516D4 /* NLAuthViewController.h */, + B5AA05CD189ED0DA00F516D4 /* NLAuthViewController.m */, + B5B3F54C18A12FA00043E3CE /* NLMapViewController.h */, + B5B3F54D18A12FA00043E3CE /* NLMapViewController.m */, + B5AA05D9189EE2E700F516D4 /* NLTableViewController.h */, + B5AA05DA189EE2E700F516D4 /* NLTableViewController.m */, + B5AA05D7189EDC8C00F516D4 /* NLAutomaticSecrets.plist */, B536C103188DED9400C02470 /* Info.plist */, B536C104188DED9400C02470 /* Prefix.pch */, B536C105188DED9400C02470 /* InfoPlist.strings */, @@ -157,7 +169,7 @@ isa = PBXGroup; children = ( B536C10F188DED9C00C02470 /* Specs-Info.plist */, - B536C110188DED9C00C02470 /* BDKAutomaticTests.m */, + B536C110188DED9C00C02470 /* NLAutomaticTests.m */, B536C111188DED9C00C02470 /* InfoPlist.strings */, ); path = Specs; @@ -166,9 +178,9 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - B52A0D17188DED6C00C21D6C /* BDKAutomatic */ = { + B52A0D17188DED6C00C21D6C /* NLAutomatic */ = { isa = PBXNativeTarget; - buildConfigurationList = B52A0D44188DED6C00C21D6C /* Build configuration list for PBXNativeTarget "BDKAutomatic" */; + buildConfigurationList = B52A0D44188DED6C00C21D6C /* Build configuration list for PBXNativeTarget "NLAutomatic" */; buildPhases = ( 337D016C90B84EE79DAC83FE /* Check Pods Manifest.lock */, B52A0D14188DED6C00C21D6C /* Sources */, @@ -180,9 +192,9 @@ ); dependencies = ( ); - name = BDKAutomatic; + name = NLAutomatic; productName = BDKAutomatic; - productReference = B52A0D18188DED6C00C21D6C /* BDKAutomatic.app */; + productReference = B52A0D18188DED6C00C21D6C /* NLAutomatic.app */; productType = "com.apple.product-type.application"; }; B52A0D32188DED6C00C21D6C /* Specs */ = { @@ -212,7 +224,7 @@ isa = PBXProject; attributes = { CLASSPREFIX = BDK; - LastUpgradeCheck = 0500; + LastUpgradeCheck = 0630; ORGANIZATIONNAME = "Ben Kreeger"; TargetAttributes = { B52A0D32188DED6C00C21D6C = { @@ -220,7 +232,7 @@ }; }; }; - buildConfigurationList = B52A0D13188DED6B00C21D6C /* Build configuration list for PBXProject "BDKAutomatic" */; + buildConfigurationList = B52A0D13188DED6B00C21D6C /* Build configuration list for PBXProject "NLAutomatic" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; @@ -232,7 +244,7 @@ projectDirPath = ""; projectRoot = ""; targets = ( - B52A0D17188DED6C00C21D6C /* BDKAutomatic */, + B52A0D17188DED6C00C21D6C /* NLAutomatic */, B52A0D32188DED6C00C21D6C /* Specs */, ); }; @@ -244,7 +256,7 @@ buildActionMask = 2147483647; files = ( B536C10C188DED9400C02470 /* Images.xcassets in Resources */, - B5AA05D8189EDC8C00F516D4 /* BDKAutomaticSecrets.plist in Resources */, + B5AA05D8189EDC8C00F516D4 /* NLAutomaticSecrets.plist in Resources */, B536C10B188DED9400C02470 /* InfoPlist.strings in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -288,7 +300,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Pods-resources.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; showEnvVarsInLog = 0; }; 8FFD181ED77E463B942022A1 /* Check Pods Manifest.lock */ = { @@ -318,7 +330,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Pods-Specs-resources.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Specs/Pods-Specs-resources.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -328,11 +340,11 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - B5B3F54E18A12FA00043E3CE /* BDKMapViewController.m in Sources */, - B5AA05CE189ED0DA00F516D4 /* BDKAuthViewController.m in Sources */, + B5B3F54E18A12FA00043E3CE /* NLMapViewController.m in Sources */, + B5AA05CE189ED0DA00F516D4 /* NLAuthViewController.m in Sources */, B536C10D188DED9400C02470 /* main.m in Sources */, - B536C109188DED9400C02470 /* BDKAppDelegate.m in Sources */, - B5AA05DB189EE2E700F516D4 /* BDKTableViewController.m in Sources */, + B536C109188DED9400C02470 /* NLAppDelegate.m in Sources */, + B5AA05DB189EE2E700F516D4 /* NLTableViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -340,7 +352,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - B536C114188DED9C00C02470 /* BDKAutomaticTests.m in Sources */, + B536C114188DED9C00C02470 /* NLAutomaticTests.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -349,7 +361,7 @@ /* Begin PBXTargetDependency section */ B52A0D39188DED6C00C21D6C /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = B52A0D17188DED6C00C21D6C /* BDKAutomatic */; + target = B52A0D17188DED6C00C21D6C /* NLAutomatic */; targetProxy = B52A0D38188DED6C00C21D6C /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ @@ -378,7 +390,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -417,7 +428,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -448,14 +458,14 @@ }; B52A0D45188DED6C00C21D6C /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = ED02175D452F4A59AE76AD72 /* Pods.xcconfig */; + baseConfigurationReference = E93DE9D0A47914EF61C0E278 /* Pods.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = Classes/Prefix.pch; INFOPLIST_FILE = "$(SRCROOT)/Classes/Info.plist"; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_NAME = NLAutomatic; TARGETED_DEVICE_FAMILY = 1; WRAPPER_EXTENSION = app; }; @@ -463,14 +473,14 @@ }; B52A0D46188DED6C00C21D6C /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = ED02175D452F4A59AE76AD72 /* Pods.xcconfig */; + baseConfigurationReference = DAA188196C9D81BE0DB0A0CB /* Pods.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = Classes/Prefix.pch; INFOPLIST_FILE = "$(SRCROOT)/Classes/Info.plist"; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_NAME = NLAutomatic; TARGETED_DEVICE_FAMILY = 1; WRAPPER_EXTENSION = app; }; @@ -478,10 +488,8 @@ }; B52A0D48188DED6C00C21D6C /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 5A6E3BC3E34B4B1480D24EF3 /* Pods-Specs.xcconfig */; + baseConfigurationReference = 70EB720583C2358271A8F2EC /* Pods-Specs.debug.xcconfig */; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; - BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/BDKAutomatic.app/BDKAutomatic"; FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", @@ -502,10 +510,8 @@ }; B52A0D49188DED6C00C21D6C /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 5A6E3BC3E34B4B1480D24EF3 /* Pods-Specs.xcconfig */; + baseConfigurationReference = F3F51D676EFA11B4330A349B /* Pods-Specs.release.xcconfig */; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; - BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/BDKAutomatic.app/BDKAutomatic"; FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", @@ -523,7 +529,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - B52A0D13188DED6B00C21D6C /* Build configuration list for PBXProject "BDKAutomatic" */ = { + B52A0D13188DED6B00C21D6C /* Build configuration list for PBXProject "NLAutomatic" */ = { isa = XCConfigurationList; buildConfigurations = ( B52A0D42188DED6C00C21D6C /* Debug */, @@ -532,7 +538,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - B52A0D44188DED6C00C21D6C /* Build configuration list for PBXNativeTarget "BDKAutomatic" */ = { + B52A0D44188DED6C00C21D6C /* Build configuration list for PBXNativeTarget "NLAutomatic" */ = { isa = XCConfigurationList; buildConfigurations = ( B52A0D45188DED6C00C21D6C /* Debug */, diff --git a/Project/BDKAutomatic.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Project/NLAutomatic.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from Project/BDKAutomatic.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to Project/NLAutomatic.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/Project/BDKAutomatic.xcodeproj/xcshareddata/xcschemes/BDKAutomatic.xcscheme b/Project/NLAutomatic.xcodeproj/xcshareddata/xcschemes/NLAutomatic.xcscheme similarity index 76% rename from Project/BDKAutomatic.xcodeproj/xcshareddata/xcschemes/BDKAutomatic.xcscheme rename to Project/NLAutomatic.xcodeproj/xcshareddata/xcschemes/NLAutomatic.xcscheme index b2db8d0..b2cda49 100644 --- a/Project/BDKAutomatic.xcodeproj/xcshareddata/xcschemes/BDKAutomatic.xcscheme +++ b/Project/NLAutomatic.xcodeproj/xcshareddata/xcschemes/NLAutomatic.xcscheme @@ -1,6 +1,6 @@ + BuildableName = "NLAutomatic.app" + BlueprintName = "NLAutomatic" + ReferencedContainer = "container:NLAutomatic.xcodeproj"> @@ -35,7 +35,7 @@ BlueprintIdentifier = "B52A0D32188DED6C00C21D6C" BuildableName = "Specs.xctest" BlueprintName = "Specs" - ReferencedContainer = "container:BDKAutomatic.xcodeproj"> + ReferencedContainer = "container:NLAutomatic.xcodeproj"> @@ -43,9 +43,9 @@ + BuildableName = "NLAutomatic.app" + BlueprintName = "NLAutomatic" + ReferencedContainer = "container:NLAutomatic.xcodeproj"> @@ -58,13 +58,14 @@ ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" allowLocationSimulation = "YES"> - + + BuildableName = "NLAutomatic.app" + BlueprintName = "NLAutomatic" + ReferencedContainer = "container:NLAutomatic.xcodeproj"> @@ -76,13 +77,14 @@ useCustomWorkingDirectory = "NO" buildConfiguration = "Release" debugDocumentVersioning = "YES"> - + + BuildableName = "NLAutomatic.app" + BlueprintName = "NLAutomatic" + ReferencedContainer = "container:NLAutomatic.xcodeproj"> diff --git a/Project/BDKAutomaticDemo.gif b/Project/NLAutomaticDemo.gif similarity index 100% rename from Project/BDKAutomaticDemo.gif rename to Project/NLAutomaticDemo.gif diff --git a/Project/Podfile b/Project/Podfile index 17212ba..f563d52 100644 --- a/Project/Podfile +++ b/Project/Podfile @@ -1,7 +1,7 @@ -pod "BDKAutomatic", :path => "../BDKAutomatic.podspec" +pod "NLAutomatic", :path => "../NLAutomatic.podspec" pod 'Reveal-iOS-SDK' -# target "BDKAutomatic" do +# target "NLAutomatic" do # end diff --git a/Project/Podfile.lock b/Project/Podfile.lock index 6d5f201..6c0f57f 100644 --- a/Project/Podfile.lock +++ b/Project/Podfile.lock @@ -1,35 +1,42 @@ PODS: - - AFNetworking/NSURLConnection (2.0.3): + - AFNetworking/NSURLConnection (2.5.2): - AFNetworking/Reachability - AFNetworking/Security - AFNetworking/Serialization - - AFNetworking/NSURLSession (2.0.3): - - AFNetworking/NSURLConnection - - AFNetworking/Reachability (2.0.3) - - AFNetworking/Security (2.0.3) - - AFNetworking/Serialization (2.0.3) - - BDKAutomatic (0.1.0): - - AFNetworking/NSURLSession (~> 2.0.0) - - AFNetworking/Serialization (~> 2.0.0) - - Expecta (HEAD based on 0.2.3) - - Reveal-iOS-SDK (1.0.3) - - Specta (HEAD based on 0.2.1) + - AFNetworking/Reachability (2.5.2) + - AFNetworking/Security (2.5.2) + - AFNetworking/Serialization (2.5.2) + - Expecta (HEAD based on 0.3.2) + - NLAutomatic (0.1.0): + - NLAutomatic/Adapter (= 0.1.0) + - NLAutomatic/MKPolyline (= 0.1.0) + - NLAutomatic/Promise (= 0.1.0) + - NLAutomatic/Adapter (0.1.0): + - AFNetworking/NSURLConnection (~> 2.0) + - NLAutomatic/MKPolyline (0.1.0) + - NLAutomatic/Promise (0.1.0): + - NLAutomatic/Adapter + - PromiseKit/Promise + - PromiseKit/Promise (1.4.2) + - Reveal-iOS-SDK (1.5.1) + - Specta (HEAD based on 0.5.0) DEPENDENCIES: - - BDKAutomatic (from `../BDKAutomatic.podspec`) - Expecta (HEAD) + - NLAutomatic (from `../NLAutomatic.podspec`) - Reveal-iOS-SDK - Specta (HEAD) EXTERNAL SOURCES: - BDKAutomatic: - :path: ../BDKAutomatic.podspec + NLAutomatic: + :path: ../NLAutomatic.podspec SPEC CHECKSUMS: - AFNetworking: e499052cbf3d743e9bb727bb37adb9dc2547ba15 - BDKAutomatic: 6cec6aadfd72ed1b2c3de04fc30bbeb3ae64348a - Expecta: dbc4a27fabb853bdd2e907e33f11ee43a9a47d0c - Reveal-iOS-SDK: f2525cb560a564fdc086316e89ec45ced6977fd3 - Specta: 2d06220591110c6d9757d8be8ecf8e63aa40dc2a + AFNetworking: fefbce9660acb17f48ae0011292d4da0f457bf36 + Expecta: 8c507baf13211207b1e9d0a741480600e6b4ed15 + NLAutomatic: 4480f3297183d1e75f383403d56abe82866174c6 + PromiseKit: ea36001b558f42aa104a1422f305b46f8c343f2e + Reveal-iOS-SDK: c9c55cad2729c85f6ced415f1b21857c9a2d8ef9 + Specta: eb90708ed77569bbda089f8ead10bb99b8e9489e -COCOAPODS: 0.29.0 +COCOAPODS: 0.36.0 diff --git a/Project/Specs/BDKAutomaticTests.m b/Project/Specs/NLAutomaticTests.m similarity index 81% rename from Project/Specs/BDKAutomaticTests.m rename to Project/Specs/NLAutomaticTests.m index d44921f..55c0751 100644 --- a/Project/Specs/BDKAutomaticTests.m +++ b/Project/Specs/NLAutomaticTests.m @@ -1,6 +1,6 @@ // -// BDKAutomaticTests.m -// BDKAutomaticTests +// NLAutomaticTests.m +// NLAutomaticTests // // Created by Ben Kreeger on 1/20/14. // Copyright (c) 2014 Ben Kreeger. All rights reserved. @@ -8,11 +8,11 @@ #import -@interface BDKAutomaticTests : XCTestCase +@interface NLAutomaticTests : XCTestCase @end -@implementation BDKAutomaticTests +@implementation NLAutomaticTests - (void)setUp { diff --git a/readme.markdown b/readme.markdown index d8358ba..9e6372a 100644 --- a/readme.markdown +++ b/readme.markdown @@ -1,8 +1,7 @@ -# BDKAutomatic +# NLAutomatic -[![Version](http://cocoapod-badges.herokuapp.com/v/BDKAutomatic/badge.png)](http://cocoadocs.org/docsets/BDKAutomatic) -[![Platform](http://cocoapod-badges.herokuapp.com/p/BDKAutomatic/badge.png)](http://cocoadocs.org/docsets/BDKAutomatic) -[![Build Status](https://travis-ci.org/kreeger/BDKAutomatic.png?branch=master)](https://travis-ci.org/kreeger/BDKAutomatic) +[![Version](http://cocoapod-badges.herokuapp.com/v/NLAutomatic/badge.png)](http://cocoadocs.org/docsets/NLAutomatic) +[![Platform](http://cocoapod-badges.herokuapp.com/p/NLAutomatic/badge.png)](http://cocoadocs.org/docsets/NLAutomatic) ## Overview @@ -14,64 +13,60 @@ A library, along with a sample project, that demonstrates some basic usage of th Sweet GIF action: -![In action](https://raw.github.com/kreeger/BDKAutomatic/master/Project/BDKAutomaticDemo.gif) +![In action](https://raw.github.com/nelsonleduc/NLAutomatic/master/Project/NLAutomaticDemo.gif) ## Usage -Just include `#import ` at the top of whatever Objective-C thing you're doing, and fire away. +Just include `#import ` at the top of whatever Objective-C thing you're doing, and fire away. ``` objective-c -BDKAutomatic *adapter = [[BDKAutomatic alloc] initWithClientId:clientId +NLAutomatic *adapter = [[NLAutomatic alloc] initWithClientId:clientId clientSecret:clientSecret redirectUrl:redirectUrl]; ``` -You'll need to authenticate it against a user account using the OAuth2 dance. See `-[BDKAuthViewController handleAutomaticAuthenticationQueryString:]` for usage examples. Once you trade your authorization code for a legitimate `BDKAutomaticToken` (which conforms to `NSCopying`, by the way, so you can marshal that bad boy to Keychain or something), you can make calls on behalf of an Automatic user. +You'll need to authenticate it against a user account using the OAuth2 dance. See `-[NLAuthViewController handleAutomaticAuthenticationQueryString:]` for usage examples. Once you trade your authorization code for a legitimate `NLAutomaticToken` (which conforms to `NSCopying`, by the way, so you can marshal that bad boy to Keychain or something), you can make calls on behalf of an Automatic user. ``` objective-c [self.automatic getTrips:^(NSError *error, NSArray *trips) { - BDKAutomaticTrip *trip = [trips firstObject]; + NLAutomaticTrip *trip = [trips firstObject]; NSLog(@"Trip started %@.", trip.startTime); }]; ``` -If you want an `MKPolyline` out of `-[BDKAutomaticTrip path]`, you'll want to include the separate `BDKAutomatic/MKPolylineSupport` subspec in your `Podfile`, and use it like so. +If you want an `MKPolyline` out of `-[NLAutomaticTrip path]`, you'll want to include the separate `NLAutomatic/MKPolylineSupport` subspec in your `Podfile`, and use it like so. ``` objective-c -#import +#import ... MKPolyline *mapPath = [MKPolyline polylineWithEncodedString:trip.path]; [self.mapView addOverlay:mapPath level:MKOverlayLevelAboveRoads]; ``` -You get the idea. See `BDKMapViewController.m` for more goodies. +You get the idea. See `NLMapViewController.m` for more goodies. ## Example project setup -To run the example project; clone the repo, and run `pod install` from the Project directory first. Then, open `BDKAutomatic.xcworkspace` in the Project directory. +To run the example project; clone the repo, and run `pod install` from the Project directory first. Then, open `NLAutomatic.xcworkspace` in the Project directory. -You'll want to copy the secret PLIST file from `Project/Classes/BDKAutomaticSecrets.plist.example` to `Project/Classes/BDKAutomaticSecrets.plist` and fill it out with your Automatic API client ID and client secret. +You'll want to copy the secret PLIST file from `Project/Classes/NLAutomaticSecrets.plist.example` to `Project/Classes/NLAutomaticSecrets.plist` and fill it out with your Automatic API client ID and client secret. ## Installation -BDKAutomatic is available through [CocoaPods](http://cocoapods.org), which is righteously awesome. To install it, simply add the following line to your Podfile. +NLAutomatic is available through [CocoaPods](http://cocoapods.org), which is righteously awesome. To install it, simply add the following line to your Podfile. ``` ruby -pod 'BDKAutomatic' +pod 'NLAutomatic' ``` -If you don't want to use the "path-to-`MKPolyline`" functionality, just use [the subspec for the adapter](https://github.com/kreeger/BDKAutomatic/blob/master/BDKAutomatic.podspec#L14). +If you don't want to use the "path-to-`MKPolyline`" functionality, just use [the subspec for the adapter](https://github.com/nelsonleduc/NLAutomatic/blob/master/NLAutomatic.podspec#L14). ``` ruby -pod 'BDKAutomatic/Adapter' +pod 'NLAutomatic/Adapter' ``` -## Author - -Ben Kreeger, ben@kree.gr - ## License -BDKAutomatic is available under the MIT license. See the LICENSE file for more info. +NLAutomatic is available under the MIT license. See the LICENSE file for more info. [rest]: https://www.automatic.com/developer/