From 75966e2a94b85aeed5905c6f83754ac085601942 Mon Sep 17 00:00:00 2001 From: Giuseppe Nucifora Date: Fri, 15 Jan 2016 17:45:16 +0100 Subject: [PATCH] - Add subclassing --- Example/PNObject/Main.storyboard | 6 +++--- Example/PNObject/PNObjectAppDelegate.m | 4 ++-- Pod/Classes/PNObject.h | 1 - Pod/Classes/PNObject.m | 26 -------------------------- Pod/Classes/PNObjectSubclassing.h | 1 + Pod/Classes/User/PNUser.h | 2 -- 6 files changed, 6 insertions(+), 34 deletions(-) diff --git a/Example/PNObject/Main.storyboard b/Example/PNObject/Main.storyboard index 9a39d6c..9dfa215 100644 --- a/Example/PNObject/Main.storyboard +++ b/Example/PNObject/Main.storyboard @@ -1,11 +1,11 @@ - + - + - + diff --git a/Example/PNObject/PNObjectAppDelegate.m b/Example/PNObject/PNObjectAppDelegate.m index 22a336d..a60328a 100644 --- a/Example/PNObject/PNObjectAppDelegate.m +++ b/Example/PNObject/PNObjectAppDelegate.m @@ -14,7 +14,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. - [PNObjectConfig initSharedInstanceForEnvironments:@{ EnvironmentDevelopment : @"https://development.it/api/v1", + /*[PNObjectConfig initSharedInstanceForEnvironments:@{ EnvironmentDevelopment : @"https://development.it/api/v1", EnvironmentStage : @"https://stage.it/api/v1", EnvironmentProduction : @"http://pnobjectdemo.giuseppenucifora.com/" }]; @@ -22,7 +22,7 @@ [[PNObjectConfig sharedInstance] setEnvironment:Production]; - [PNObject get]; + [PNObject get];*/ return YES; } diff --git a/Pod/Classes/PNObject.h b/Pod/Classes/PNObject.h index 287f6d7..08f5f43 100644 --- a/Pod/Classes/PNObject.h +++ b/Pod/Classes/PNObject.h @@ -19,5 +19,4 @@ - (instancetype) initWithJSON:(NSDictionary*) JSON; -+ (void) get; @end diff --git a/Pod/Classes/PNObject.m b/Pod/Classes/PNObject.m index 5363b77..99edcde 100644 --- a/Pod/Classes/PNObject.m +++ b/Pod/Classes/PNObject.m @@ -22,32 +22,6 @@ @implementation PNObject - -+ (void) get { - - AFHTTPSessionManager *manager = [AFHTTPSessionManager manager]; - manager.securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeCertificate]; - manager.securityPolicy.allowInvalidCertificates = YES; - - [manager GET:[[[PNObjectConfig sharedInstance] PNObjEndpoint] stringByAppendingFormat:@"%@",@"User"] parameters:nil progress:nil success:^(NSURLSessionTask *task, id responseObject) { - - - NSLog(@"JSON: %@", responseObject); - NSLog(@"JSON: %@", [responseObject class]); - - PNUser *user = [[PNUser alloc] initWithJSON:responseObject]; - - NSLog(@"%@",user); - - - } failure:^(NSURLSessionTask *operation, NSError *error) { - - NSLog(@"Error: %@", error); - - }]; -} - - - (instancetype) init { self = [super init]; diff --git a/Pod/Classes/PNObjectSubclassing.h b/Pod/Classes/PNObjectSubclassing.h index 5e3a7c5..f0f8c2b 100644 --- a/Pod/Classes/PNObjectSubclassing.h +++ b/Pod/Classes/PNObjectSubclassing.h @@ -17,4 +17,5 @@ + (NSDictionary *) objcetMapping; + @end diff --git a/Pod/Classes/User/PNUser.h b/Pod/Classes/User/PNUser.h index 3743fb7..3b04509 100644 --- a/Pod/Classes/User/PNUser.h +++ b/Pod/Classes/User/PNUser.h @@ -31,6 +31,4 @@ @property (nonatomic, strong) NSString *facebookAccessToken; @property (nonatomic, strong) PNAddress *address; - - @end