File tree 3 files changed +11
-8
lines changed
3 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ NS_ASSUME_NONNULL_BEGIN
18
18
The `PFRelation` class that is used to access all of the children of a many-to-many relationship.
19
19
Each instance of `PFRelation` is associated with a particular parent object and key.
20
20
*/
21
- @interface PFRelation : NSObject
21
+ @interface PFRelation <ObjectType : PFObject *> : NSObject
22
22
23
23
/* *
24
24
The name of the class of the target child objects.
@@ -32,7 +32,7 @@ NS_ASSUME_NONNULL_BEGIN
32
32
/* *
33
33
Returns a `PFQuery` object that can be used to get objects in this relation.
34
34
*/
35
- - (PFQuery *)query ;
35
+ - (PFQuery<ObjectType> *)query ;
36
36
37
37
// /--------------------------------------
38
38
#pragma mark - Modifying Relations
@@ -43,14 +43,14 @@ NS_ASSUME_NONNULL_BEGIN
43
43
44
44
@param object A `PFObject` object to add relation to.
45
45
*/
46
- - (void )addObject : (PFObject * )object ;
46
+ - (void )addObject : (ObjectType )object ;
47
47
48
48
/* *
49
49
Removes a relation to the passed in object.
50
50
51
51
@param object A `PFObject` object to add relation to.
52
52
*/
53
- - (void )removeObject : (PFObject * )object ;
53
+ - (void )removeObject : (ObjectType )object ;
54
54
55
55
@end
56
56
Original file line number Diff line number Diff line change 11
11
12
12
#import < Parse/PFObject.h>
13
13
#import < Parse/PFSubclassing.h>
14
+ #import < Parse/PFUser.h>
14
15
15
16
NS_ASSUME_NONNULL_BEGIN
16
17
18
+ @class PFRelation<ObjectType : PFObject *>;
19
+
17
20
/* *
18
21
The `PFRole` class represents a Role on the Parse server.
19
22
`PFRoles` represent groupings of `PFUser` objects for the purposes of granting permissions
@@ -83,7 +86,7 @@ NS_ASSUME_NONNULL_BEGIN
83
86
(e.g. read or write access through ACLs). You can add or remove users from
84
87
the role through this relation.
85
88
*/
86
- @property (nonatomic , strong , readonly ) PFRelation *users;
89
+ @property (nonatomic , strong , readonly ) PFRelation<PFUser *> *users;
87
90
88
91
/* *
89
92
Gets the `PFRelation` for the `PFRole` objects that are direct children of this role.
@@ -92,7 +95,7 @@ NS_ASSUME_NONNULL_BEGIN
92
95
(e.g. read or write access through ACLs). You can add or remove child roles
93
96
from this role through this relation.
94
97
*/
95
- @property (nonatomic , strong , readonly ) PFRelation *roles;
98
+ @property (nonatomic , strong , readonly ) PFRelation<PFRole *> *roles;
96
99
97
100
@end
98
101
Original file line number Diff line number Diff line change @@ -51,11 +51,11 @@ + (instancetype)roleWithName:(NSString *)name acl:(PFACL *)acl {
51
51
@dynamic name;
52
52
53
53
// Dynamic synthesizers would use objectForKey, not relationForKey
54
- - (PFRelation *)roles {
54
+ - (PFRelation<PFRole *> *)roles {
55
55
return [self relationForKey: @keypath (PFRole, roles)];
56
56
}
57
57
58
- - (PFRelation *)users {
58
+ - (PFRelation<PFUser *> *)users {
59
59
return [self relationForKey: @keypath (PFRole, users)];
60
60
}
61
61
You can’t perform that action at this time.
0 commit comments