Skip to content

Commit c49b2ea

Browse files
committed
Specify generic type for users, roles relations in PFRole.
1 parent 9c4b7c7 commit c49b2ea

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Parse/PFRole.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@
1111

1212
#import <Parse/PFObject.h>
1313
#import <Parse/PFSubclassing.h>
14+
#import <Parse/PFUser.h>
1415

1516
NS_ASSUME_NONNULL_BEGIN
1617

18+
@class PFRelation<ObjectType : PFObject *>;
19+
1720
/**
1821
The `PFRole` class represents a Role on the Parse server.
1922
`PFRoles` represent groupings of `PFUser` objects for the purposes of granting permissions
@@ -83,7 +86,7 @@ NS_ASSUME_NONNULL_BEGIN
8386
(e.g. read or write access through ACLs). You can add or remove users from
8487
the role through this relation.
8588
*/
86-
@property (nonatomic, strong, readonly) PFRelation *users;
89+
@property (nonatomic, strong, readonly) PFRelation<PFUser *> *users;
8790

8891
/**
8992
Gets the `PFRelation` for the `PFRole` objects that are direct children of this role.
@@ -92,7 +95,7 @@ NS_ASSUME_NONNULL_BEGIN
9295
(e.g. read or write access through ACLs). You can add or remove child roles
9396
from this role through this relation.
9497
*/
95-
@property (nonatomic, strong, readonly) PFRelation *roles;
98+
@property (nonatomic, strong, readonly) PFRelation<PFRole *> *roles;
9699

97100
@end
98101

Parse/PFRole.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ + (instancetype)roleWithName:(NSString *)name acl:(PFACL *)acl {
5151
@dynamic name;
5252

5353
// Dynamic synthesizers would use objectForKey, not relationForKey
54-
- (PFRelation *)roles {
54+
- (PFRelation<PFRole *> *)roles {
5555
return [self relationForKey:@keypath(PFRole, roles)];
5656
}
5757

58-
- (PFRelation *)users {
58+
- (PFRelation<PFUser *> *)users {
5959
return [self relationForKey:@keypath(PFRole, users)];
6060
}
6161

0 commit comments

Comments
 (0)