PNObject/Pod/Classes/PNObject.h

57 lines
979 B
Objective-C

//
// PNObject.h
// Pods
//
// Created by Giuseppe Nucifora on 28/12/15.
//
//
#import <Foundation/Foundation.h>
#import "PNObjectConfig.h"
#import "PNObjectModel.h"
@protocol PNObjectSubclassing <NSObject>
@required
+ (NSDictionary * _Nonnull) objcetMapping;
+ (BOOL) singleInstance;
@optional
+ (NSString * _Nonnull ) objectClassName;
@end
@interface PNObject : NSObject
+ (NSString * _Nonnull) PNObjClassName;
- (_Nullable instancetype) initWithJSON:( NSDictionary * _Nonnull) JSON;
- (id _Nonnull) saveLocally;
- (BOOL) autoRemoveLocally;
///--------------------------------------
#pragma mark - PNObject Properties
///--------------------------------------
/**
* <#Description#>
*/
@property (nonatomic, strong, nonnull) NSString * objID;
/**
* <#Description#>
*/
@property (nonatomic, strong, nonnull) NSDate * createdAt;
/**
* <#Description#>
*/
@property (nonatomic, strong, getter=getJSONObject, nonnull) NSDictionary * objectMapping;
@end