14
14
#import " PFQueryState.h"
15
15
#import " PFAssert.h"
16
16
17
+ NS_ASSUME_NONNULL_BEGIN
18
+
17
19
@implementation PFPushState
18
20
19
21
// /--------------------------------------
20
22
#pragma mark - PFBaseStateSubclass
21
23
// /--------------------------------------
22
24
23
25
+ (NSDictionary *)propertyAttributes {
24
- return @{ @" channels" : [PFPropertyAttributes attributesWithAssociationType: PFPropertyInfoAssociationTypeCopy],
25
- @" queryState" : [PFPropertyAttributes attributesWithAssociationType: PFPropertyInfoAssociationTypeCopy],
26
- @" expirationDate" : [PFPropertyAttributes attributesWithAssociationType: PFPropertyInfoAssociationTypeStrong],
27
- @" expirationTimeInterval" : [PFPropertyAttributes attributesWithAssociationType: PFPropertyInfoAssociationTypeStrong],
28
- @" pushDate" : [PFPropertyAttributes attributesWithAssociationType: PFPropertyInfoAssociationTypeStrong],
29
- @" payload" : [PFPropertyAttributes attributesWithAssociationType: PFPropertyInfoAssociationTypeCopy] };
26
+ return @{ PFPushStatePropertyName ( channels) : [PFPropertyAttributes attributesWithAssociationType: PFPropertyInfoAssociationTypeCopy],
27
+ PFPushStatePropertyName ( queryState) : [PFPropertyAttributes attributesWithAssociationType: PFPropertyInfoAssociationTypeCopy],
28
+ PFPushStatePropertyName ( expirationDate) : [PFPropertyAttributes attributesWithAssociationType: PFPropertyInfoAssociationTypeStrong],
29
+ PFPushStatePropertyName ( expirationTimeInterval) : [PFPropertyAttributes attributesWithAssociationType: PFPropertyInfoAssociationTypeStrong],
30
+ PFPushStatePropertyName ( pushDate) : [PFPropertyAttributes attributesWithAssociationType: PFPropertyInfoAssociationTypeStrong],
31
+ PFPushStatePropertyName ( payload) : [PFPropertyAttributes attributesWithAssociationType: PFPropertyInfoAssociationTypeCopy] };
30
32
}
31
33
32
34
// /--------------------------------------
33
35
#pragma mark - Init
34
36
// /--------------------------------------
35
37
36
- - (instancetype )initWithState : (PFPushState *)state {
38
+ - (instancetype )initWithState : (nullable PFPushState *)state {
37
39
return [super initWithState: state];
38
40
}
39
41
40
- + (instancetype )stateWithState : (PFPushState *)state {
42
+ + (instancetype )stateWithState : (nullable PFPushState *)state {
41
43
return [super stateWithState: state];
42
44
}
43
45
44
46
// /--------------------------------------
45
47
#pragma mark - NSCopying
46
48
// /--------------------------------------
47
49
48
- - (void )setPushDate : (NSDate *)pushDate {
50
+ - (void )setPushDate : (nullable NSDate *)pushDate {
49
51
if (self.pushDate != pushDate) {
50
52
NSTimeInterval interval = pushDate.timeIntervalSinceNow ;
51
53
PFParameterAssert (interval > 0 , @" Can't set the scheduled push time in the past." );
@@ -58,16 +60,18 @@ - (void)setPushDate:(NSDate *)pushDate {
58
60
#pragma mark - NSCopying
59
61
// /--------------------------------------
60
62
61
- - (id )copyWithZone : (NSZone *)zone {
63
+ - (id )copyWithZone : (nullable NSZone *)zone {
62
64
return [[PFPushState allocWithZone: zone] initWithState: self ];
63
65
}
64
66
65
67
// /--------------------------------------
66
68
#pragma mark - NSMutableCopying
67
69
// /--------------------------------------
68
70
69
- - (id )mutableCopyWithZone : (NSZone *)zone {
71
+ - (id )mutableCopyWithZone : (nullable NSZone *)zone {
70
72
return [[PFMutablePushState allocWithZone: zone] initWithState: self ];
71
73
}
72
74
73
75
@end
76
+
77
+ NS_ASSUME_NONNULL_END
0 commit comments