Browse Source

Make handlers private

booker 5 years ago
parent
commit
3dbee48382
2 changed files with 7 additions and 5 deletions
  1. 0
    2
      ios/RNPermissions.h
  2. 7
    3
      ios/RNPermissions.m

+ 0
- 2
ios/RNPermissions.h View File

79
 
79
 
80
 @interface RNPermissions : NSObject <RCTBridgeModule>
80
 @interface RNPermissions : NSObject <RCTBridgeModule>
81
 
81
 
82
-@property (nonatomic, strong) NSMutableDictionary<NSString *, id<RNPermissionHandler>>  *_Nonnull handlers;
83
-
84
 + (bool)isFlaggedAsRequested:(NSString * _Nonnull)handlerId;
82
 + (bool)isFlaggedAsRequested:(NSString * _Nonnull)handlerId;
85
 
83
 
86
 + (void)flagAsRequested:(NSString * _Nonnull)handlerId;
84
 + (void)flagAsRequested:(NSString * _Nonnull)handlerId;

+ 7
- 3
ios/RNPermissions.m View File

104
 
104
 
105
 @end
105
 @end
106
 
106
 
107
+@interface RNPermissions ()
108
+@property (nonatomic, strong) NSMutableDictionary<NSString *, id<RNPermissionHandler>>  *_Nonnull handlers;
109
+@end
110
+
107
 @implementation RNPermissions
111
 @implementation RNPermissions
108
 
112
 
109
 RCT_EXPORT_MODULE();
113
 RCT_EXPORT_MODULE();
226
 }
230
 }
227
 
231
 
228
 - (NSString *)insertHandler:(id<RNPermissionHandler>)handler {
232
 - (NSString *)insertHandler:(id<RNPermissionHandler>)handler {
229
-    if( self.handlers == nil){
230
-        self.handlers = [NSMutableDictionary new];
233
+    if(_handlers == nil){
234
+        _handlers = [NSMutableDictionary new];
231
     }
235
     }
232
     
236
     
233
     NSString *randomId = [[NSUUID UUID] UUIDString];
237
     NSString *randomId = [[NSUUID UUID] UUIDString];
234
     
238
     
235
-    [self.handlers setObject:handler forKey:randomId];
239
+    [_handlers setObject:handler forKey:randomId];
236
     
240
     
237
     return randomId;
241
     return randomId;
238
 }
242
 }