- Fix
This commit is contained in:
1 parent
bcf0dca5b2
commit
f25ede069d
6 files changed
+87
-18
No files matched your search
@@ -6,8 +6,8 @@
|
||||
//
|
||||
//
|
||||
|
||||
#import <PNObject/PNObject.h>
|
||||
#import <PNObject/PNLocation.h>
|
||||
#import "PNObject.h"
|
||||
#import "PNLocation.h"
|
||||
|
||||
@interface PNAddress : PNObject <PNObjectSubclassing>
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
//
|
||||
//
|
||||
|
||||
#import <PNObject/PNObject.h>
|
||||
#import "PNObject.h"
|
||||
|
||||
@interface PNLocation : PNObject <PNObjectSubclassing>
|
||||
|
||||
|
||||
@@ -6,14 +6,44 @@
|
||||
//
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "PNObject.h"
|
||||
#import "PNAddress.h"
|
||||
|
||||
@interface PNUser : NSObject
|
||||
@interface PNUser : PNObject <PNObjectSubclassing>
|
||||
|
||||
@property (strong, nonatomic) NSString *userId;
|
||||
@property (strong, nonatomic) NSString *firstName;
|
||||
@property (strong, nonatomic) NSString *lastName;
|
||||
@property (nonatomic, strong) NSString *profileImage;
|
||||
@property (nonatomic, strong) NSString *sex;
|
||||
@property (nonatomic, strong) NSDate *birthDate;
|
||||
@property (nonatomic, strong) NSString *phone;
|
||||
@property (nonatomic) BOOL hasAcceptedPrivacy;
|
||||
@property (nonatomic) BOOL hasAcceptedNewsletter;
|
||||
@property (nonatomic) BOOL hasVerifiedEmail;
|
||||
@property (nonatomic, strong) NSDate *emailVerifiedDate;
|
||||
@property (nonatomic, strong) NSString *email;
|
||||
@property (strong, nonatomic) NSString *username;
|
||||
@property (nonatomic) BOOL publicProfile;
|
||||
@property (nonatomic) NSInteger loginCount;
|
||||
@property (strong, nonatomic) NSDate *createdAt;
|
||||
@property (nonatomic, strong) NSString *facebookId;
|
||||
@property (nonatomic, strong) NSString *facebookAccessToken;
|
||||
@property (nonatomic, strong) PNAddress *address;
|
||||
|
||||
/**
|
||||
* gets singleton object.
|
||||
*
|
||||
* @return singleton
|
||||
*/
|
||||
+ (PNUser*)sharedInstance;
|
||||
+ (instancetype)sharedInstance;
|
||||
|
||||
|
||||
/**
|
||||
* gets singleton object of current user session.
|
||||
*
|
||||
* @return singleton
|
||||
*/
|
||||
+ (instancetype) currentUser;
|
||||
|
||||
@end
|
||||
@@ -16,7 +16,7 @@ static bool isFirstAccess = YES;
|
||||
|
||||
#pragma mark - Public Method
|
||||
|
||||
+ (id)sharedInstance
|
||||
+ (instancetype)sharedInstance
|
||||
{
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
@@ -27,29 +27,33 @@ static bool isFirstAccess = YES;
|
||||
return SINGLETON;
|
||||
}
|
||||
|
||||
+ (instancetype) currentUser {
|
||||
return [self sharedInstance];
|
||||
}
|
||||
|
||||
#pragma mark - Life Cycle
|
||||
|
||||
+ (id) allocWithZone:(NSZone *)zone
|
||||
+ (instancetype) allocWithZone:(NSZone *)zone
|
||||
{
|
||||
return [self sharedInstance];
|
||||
}
|
||||
|
||||
+ (id)copyWithZone:(struct _NSZone *)zone
|
||||
+ (instancetype)copyWithZone:(struct _NSZone *)zone
|
||||
{
|
||||
return [self sharedInstance];
|
||||
}
|
||||
|
||||
+ (id)mutableCopyWithZone:(struct _NSZone *)zone
|
||||
+ (instancetype)mutableCopyWithZone:(struct _NSZone *)zone
|
||||
{
|
||||
return [self sharedInstance];
|
||||
}
|
||||
|
||||
- (id)copy
|
||||
- (instancetype)copy
|
||||
{
|
||||
return [[PNUser alloc] init];
|
||||
}
|
||||
|
||||
- (id)mutableCopy
|
||||
- (instancetype)mutableCopy
|
||||
{
|
||||
return [[PNUser alloc] init];
|
||||
}
|
||||
@@ -66,5 +70,34 @@ static bool isFirstAccess = YES;
|
||||
return self;
|
||||
}
|
||||
|
||||
+ (NSDictionary *)objcetMapping {
|
||||
NSDictionary *mapping = @{@"userId":@"id",
|
||||
@"firstName":@"firstName",
|
||||
@"lastName":@"lastName",
|
||||
@"profileImage":@"profileImage",
|
||||
@"sex":@"sex",
|
||||
@"birthDate":@"birthDate",
|
||||
@"phone":@"phone",
|
||||
@"hasAcceptedPrivacy":@"hasAcceptedPrivacy",
|
||||
@"hasAcceptedNewsletter":@"hasAcceptedNewsletter",
|
||||
@"hasVerifiedEmail":@"hasVerifiedEmail",
|
||||
@"emailVerifiedDate":@"emailVerifiedDate",
|
||||
@"email":@"email",
|
||||
@"username":@"username",
|
||||
@"publicProfile":@"public_profile",
|
||||
@"loginCount":@"login_count",
|
||||
@"createdAt":@"created_at",
|
||||
@"facebookId":@"facebookId",
|
||||
@"facebookAccessToken":@"facebookAccessToken",
|
||||
@"address":@{@"key":@"address",@"type":@"PNAddress"}
|
||||
};
|
||||
return mapping;
|
||||
}
|
||||
|
||||
+ (NSString *)objectClassName {
|
||||
return @"User";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
||||
Reference in new issue
Block a user