diff --git a/Example/PNObject.xcodeproj/project.pbxproj b/Example/PNObject.xcodeproj/project.pbxproj index 3981db4..1df90f4 100644 --- a/Example/PNObject.xcodeproj/project.pbxproj +++ b/Example/PNObject.xcodeproj/project.pbxproj @@ -20,6 +20,7 @@ 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; }; 6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; }; + 686ABCCF1C68A439000B3F7A /* User.m in Sources */ = {isa = PBXBuildFile; fileRef = 686ABCCE1C68A439000B3F7A /* User.m */; }; DA43246C4FB8B8B587FC2343 /* Pods_PNObject_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5CB6B6AE8DC4C8FBEC56DD55 /* Pods_PNObject_Tests.framework */; }; E1806AD43C05C089D52D136E /* Pods_PNObject_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D73089A9DA261B19C7C342EA /* Pods_PNObject_Example.framework */; }; /* End PBXBuildFile section */ @@ -57,6 +58,8 @@ 6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = ""; }; 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = ""; }; + 686ABCCD1C68A439000B3F7A /* User.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = User.h; sourceTree = ""; }; + 686ABCCE1C68A439000B3F7A /* User.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = User.m; sourceTree = ""; }; 6ADA851464A35438E6A21617 /* Pods-PNObject_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PNObject_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-PNObject_Example/Pods-PNObject_Example.debug.xcconfig"; sourceTree = ""; }; 75FCB4EFD17838CCA4C93E4A /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 8C017F9292D546DE8DBC84F8 /* PNObject.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = PNObject.podspec; path = ../PNObject.podspec; sourceTree = ""; }; @@ -130,6 +133,7 @@ 6003F593195388D20070C39A /* Example for PNObject */ = { isa = PBXGroup; children = ( + 686ABCCC1C68A439000B3F7A /* User */, 6003F59C195388D20070C39A /* PNObjectAppDelegate.h */, 6003F59D195388D20070C39A /* PNObjectAppDelegate.m */, 6003F5A5195388D20070C39A /* PNObjectViewController.h */, @@ -181,6 +185,16 @@ name = "Podspec Metadata"; sourceTree = ""; }; + 686ABCCC1C68A439000B3F7A /* User */ = { + isa = PBXGroup; + children = ( + 686ABCCD1C68A439000B3F7A /* User.h */, + 686ABCCE1C68A439000B3F7A /* User.m */, + ); + name = User; + path = "../../../../../../Purplenetwork/GIT/iOS/packman-ios/packman/Model/User"; + sourceTree = ""; + }; 700947C2A719D2A125954296 /* Pods */ = { isa = PBXGroup; children = ( @@ -388,6 +402,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 686ABCCF1C68A439000B3F7A /* User.m in Sources */, 6003F59E195388D20070C39A /* PNObjectAppDelegate.m in Sources */, 6003F5A7195388D20070C39A /* PNObjectViewController.m in Sources */, 6003F59A195388D20070C39A /* main.m in Sources */, diff --git a/Example/PNObject.xcworkspace/xcshareddata/PNObject.xcscmblueprint b/Example/PNObject.xcworkspace/xcshareddata/PNObject.xcscmblueprint new file mode 100644 index 0000000..20da467 --- /dev/null +++ b/Example/PNObject.xcworkspace/xcshareddata/PNObject.xcscmblueprint @@ -0,0 +1,30 @@ +{ + "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "0D16AB9035733B66D1E42542FCF79AEB110EE3F1", + "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { + + }, + "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { + "0D16AB9035733B66D1E42542FCF79AEB110EE3F1" : 0, + "AEB0552E99BCD7202184FC09F243A3865259D36E" : 0 + }, + "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "8D791C14-A3DF-4773-86F0-EB52646714A3", + "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { + "0D16AB9035733B66D1E42542FCF79AEB110EE3F1" : "PNObject\/", + "AEB0552E99BCD7202184FC09F243A3865259D36E" : "..\/..\/..\/Purplenetwork\/GIT\/iOS\/packman-ios" + }, + "DVTSourceControlWorkspaceBlueprintNameKey" : "PNObject", + "DVTSourceControlWorkspaceBlueprintVersion" : 204, + "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "Example\/PNObject.xcworkspace", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "git.giuseppenucifora.com:giuseppenucifora\/PNObject.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "0D16AB9035733B66D1E42542FCF79AEB110EE3F1" + }, + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "git.giuseppenucifora.com:purplenetwork\/packman-ios.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "AEB0552E99BCD7202184FC09F243A3865259D36E" + } + ] +} \ No newline at end of file diff --git a/Example/PNObject/Images.xcassets/AppIcon.appiconset/Contents.json b/Example/PNObject/Images.xcassets/AppIcon.appiconset/Contents.json index 3669211..a4b3297 100644 --- a/Example/PNObject/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/Example/PNObject/Images.xcassets/AppIcon.appiconset/Contents.json @@ -1,5 +1,71 @@ { "images" : [ + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-Small.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-Small@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-Small@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-40@3x.png", + "scale" : "3x" + }, + { + "size" : "57x57", + "idiom" : "iphone", + "filename" : "Icon.png", + "scale" : "1x" + }, + { + "size" : "57x57", + "idiom" : "iphone", + "filename" : "Icon@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-60@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-Small.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-Small@2x.png", + "scale" : "2x" + }, { "size" : "40x40", "idiom" : "ipad", @@ -13,9 +79,15 @@ "scale" : "2x" }, { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-60@2x.png", + "size" : "50x50", + "idiom" : "ipad", + "filename" : "Icon-Small-50.png", + "scale" : "1x" + }, + { + "size" : "50x50", + "idiom" : "ipad", + "filename" : "Icon-Small-50@2x.png", "scale" : "2x" }, { @@ -42,84 +114,6 @@ "filename" : "Icon-76@2x.png", "scale" : "2x" }, - { - "size" : "50x50", - "idiom" : "ipad", - "filename" : "Icon-Small-50.png", - "scale" : "1x" - }, - { - "size" : "50x50", - "idiom" : "ipad", - "filename" : "Icon-Small-50@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-Small.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-Small@2x.png", - "scale" : "2x" - }, - { - "size" : "57x57", - "idiom" : "iphone", - "filename" : "Icon.png", - "scale" : "1x" - }, - { - "size" : "57x57", - "idiom" : "iphone", - "filename" : "Icon@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-Small@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-60@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-40@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-Small.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-Small@2x.png", - "scale" : "2x" - }, - { - "size" : "120x120", - "idiom" : "car", - "filename" : "Icon-120.png", - "scale" : "1x" - }, { "size" : "83.5x83.5", "idiom" : "ipad", diff --git a/Example/PNObject/Images.xcassets/AppIcon.appiconset/Icon-120.png b/Example/PNObject/Images.xcassets/AppIcon.appiconset/Icon-120.png deleted file mode 100644 index 099ca39..0000000 Binary files a/Example/PNObject/Images.xcassets/AppIcon.appiconset/Icon-120.png and /dev/null differ diff --git a/Example/PNObject/PNObjectAppDelegate.m b/Example/PNObject/PNObjectAppDelegate.m index 3b726a4..3bcccf6 100644 --- a/Example/PNObject/PNObjectAppDelegate.m +++ b/Example/PNObject/PNObjectAppDelegate.m @@ -9,10 +9,8 @@ #import "PNObjectAppDelegate.h" #import "PNObjectViewController.h" - - #import "PNObject.h" -#import "PNUser.h" +#import "User.h" #import "PNAddress.h" #import "PNObject+PNObjectConnection.h" @@ -35,7 +33,7 @@ [[PNObjectConfig sharedInstance] setEnvironment:Stage]; #endif - PNUser *user = [PNUser currentUser]; + User *user = [User currentUser]; [user setFirstName:@"Giuseppe"]; [user setLastName:@"Nuficora"]; [user setEmail:@"giuseppe.nucifora@purplenetwork.it"]; diff --git a/Example/PNObject/PNObjectViewController.m b/Example/PNObject/PNObjectViewController.m index 460bb4e..c616abc 100644 --- a/Example/PNObject/PNObjectViewController.m +++ b/Example/PNObject/PNObjectViewController.m @@ -9,7 +9,7 @@ #import "PNObjectViewController.h" #import #import "PNObject.h" -#import "PNUser.h" +#import "User.h" #import "PNAddress.h" #import "PNObject+PNObjectConnection.h" @@ -101,7 +101,7 @@ - (void) apiCallAction { - [[PNUser currentUser] registerCurrentUserWithBlockSuccess:^(id _Nullable responseObject) { + [[User currentUser] registerCurrentUserWithBlockSuccess:^(id _Nullable responseObject) { } failure:^(NSError * _Nonnull error) { diff --git a/PNObject.podspec b/PNObject.podspec index 9b6cc80..0fb898a 100644 --- a/PNObject.podspec +++ b/PNObject.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = "PNObject" -s.version = "0.3.3" +s.version = "0.3.4" s.summary = "PNObject is a simple replica of the more complex ParseObject" # This description is used to generate tags and improve search results. diff --git a/Pod/Classes/PNClasses/PNUser.h b/Pod/Classes/PNClasses/PNUser.h index 3ba306e..d026125 100644 --- a/Pod/Classes/PNClasses/PNUser.h +++ b/Pod/Classes/PNClasses/PNUser.h @@ -43,7 +43,7 @@ * @param success <#success description#> * @param failure <#failure description#> */ -- (void) registerCurrentUserWithBlockSuccess:(nullable void (^)(id _Nullable responseObject))success +- (void) registerCurrentUserWithBlockSuccess:(nullable void (^)(PNUser * _Nullable responseObject))success failure:(nullable void (^)(NSError * _Nonnull error))failure; /** diff --git a/Pod/Classes/PNClasses/PNUser.m b/Pod/Classes/PNClasses/PNUser.m index d608ce8..6ccd89d 100644 --- a/Pod/Classes/PNClasses/PNUser.m +++ b/Pod/Classes/PNClasses/PNUser.m @@ -125,13 +125,14 @@ static bool isFirstAccess = YES; return NO; } -- (void) registerCurrentUserWithBlockSuccess:(nullable void (^)(id _Nullable responseObject))success +- (void) registerCurrentUserWithBlockSuccess:(nullable void (^)(PNUser * _Nullable responseObject))success failure:(nullable void (^)(NSError * _Nonnull error))failure { [self POSTWithEndpointAction:@"registration/register" Progress:nil success:^(NSURLSessionDataTask * _Nullable task, PNObject * _Nullable responseObject) { NSLog(@"response %@",responseObject); if(success){ - success(responseObject); + success((PNUser*)responseObject); + [self saveLocally]; } } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { if (failure) { diff --git a/Pod/Classes/PNObject+Protected.m b/Pod/Classes/PNObject+Protected.m index 8c35d66..976da9f 100644 --- a/Pod/Classes/PNObject+Protected.m +++ b/Pod/Classes/PNObject+Protected.m @@ -258,7 +258,8 @@ static BOOL property_getTypeString( objc_property_t property, char *buffer ) NSMutableDictionary *results = [NSMutableDictionary dictionary]; if ([PNObjClass isSubclassOfClass:[PNObject class]] && PNObjClass != [PNObject class]) { - [results addEntriesFromDictionary:[self propertiesForClass:[PNObject class]]]; + + [results addEntriesFromDictionary:[self propertiesForClass:class_getSuperclass(PNObjClass)]]; } unsigned int outCount, i;