瀏覽代碼

Fix Xcode line formatting

Mathieu Acthernoene 6 年之前
父節點
當前提交
db15e41fd3

+ 1
- 1
ios/PermissionHandlers/Camera/RNPermissionHandlerCamera.m 查看文件

@@ -21,7 +21,7 @@
21 21
       return resolve(RNPermissionStatusAuthorized);
22 22
   }
23 23
 }
24
-  
24
+
25 25
 - (void)requestWithOptions:(__unused NSDictionary * _Nullable)options
26 26
               withResolver:(void (^)(RNPermissionStatus status))resolve
27 27
               withRejecter:(void (^)(NSError *error))reject {

+ 7
- 7
ios/PermissionHandlers/LocationAlways/RNPermissionHandlerLocationAlways.m 查看文件

@@ -26,7 +26,7 @@
26 26
   if (![CLLocationManager locationServicesEnabled]) {
27 27
     return resolve(RNPermissionStatusNotAvailable);
28 28
   }
29
-  
29
+
30 30
   switch ([CLLocationManager authorizationStatus]) {
31 31
     case kCLAuthorizationStatusNotDetermined:
32 32
       return resolve(RNPermissionStatusNotDetermined);
@@ -44,19 +44,19 @@
44 44
               withResolver:(void (^)(RNPermissionStatus status))resolve
45 45
               withRejecter:(void (^)(NSError *error))reject {
46 46
   CLAuthorizationStatus status = [CLLocationManager authorizationStatus];
47
-  
47
+
48 48
   if ((status != kCLAuthorizationStatusNotDetermined && status != kCLAuthorizationStatusAuthorizedWhenInUse) ||
49 49
       ([RNPermissionsManager hasBeenRequestedOnce:self] && status == kCLAuthorizationStatusAuthorizedWhenInUse)) {
50 50
     return [self checkWithResolver:resolve withRejecter:reject];
51 51
   }
52
-  
52
+
53 53
   _resolve = resolve;
54 54
   _reject = reject;
55
-  
55
+
56 56
   if (status == kCLAuthorizationStatusAuthorizedWhenInUse) {
57 57
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(UIApplicationDidBecomeActiveNotification:) name:UIApplicationDidBecomeActiveNotification object:nil];
58 58
   }
59
-  
59
+
60 60
   _locationManager = [CLLocationManager new];
61 61
   [_locationManager setDelegate:self];
62 62
   [_locationManager requestAlwaysAuthorization];
@@ -64,7 +64,7 @@
64 64
 
65 65
 - (void)onAuthorizationStatus {
66 66
   [self checkWithResolver:_resolve withRejecter:_reject];
67
-  
67
+
68 68
   [_locationManager setDelegate:nil];
69 69
   _locationManager = nil;
70 70
 }
@@ -81,7 +81,7 @@
81 81
   if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorizedWhenInUse) {
82 82
     [self onAuthorizationStatus];
83 83
   }
84
-  
84
+
85 85
   [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidBecomeActiveNotification object:nil];
86 86
 }
87 87
 

+ 6
- 6
ios/PermissionHandlers/Motion/RNPermissionHandlerMotion.m 查看文件

@@ -22,7 +22,7 @@ static NSString* handlerKey = @"motion";
22 22
   if (![CMMotionActivityManager isActivityAvailable]) {
23 23
     return resolve(RNPermissionStatusNotAvailable);
24 24
   }
25
-  
25
+
26 26
   if (@available(iOS 11.0, *)) {
27 27
     switch ([CMMotionActivityManager authorizationStatus]) {
28 28
       case CMAuthorizationStatusNotDetermined:
@@ -35,11 +35,11 @@ static NSString* handlerKey = @"motion";
35 35
         return resolve(RNPermissionStatusAuthorized);
36 36
     }
37 37
   }
38
-  
38
+
39 39
   if (![RNPermissionsManager hasBeenRequestedOnce:self]) {
40 40
     return resolve(RNPermissionStatusNotDetermined);
41 41
   }
42
-  
42
+
43 43
   [self requestWithOptions:nil withResolver:resolve withRejecter:reject];
44 44
 }
45 45
 
@@ -49,10 +49,10 @@ static NSString* handlerKey = @"motion";
49 49
   if (![CMMotionActivityManager isActivityAvailable]) {
50 50
     return resolve(RNPermissionStatusNotAvailable);
51 51
   }
52
-  
52
+
53 53
   _motionActivityManager = [CMMotionActivityManager new];
54 54
   _motionActivityQueue = [NSOperationQueue new];
55
-  
55
+
56 56
   [_motionActivityManager queryActivityStartingFromDate:[NSDate distantPast] toDate:[NSDate date] toQueue:_motionActivityQueue withHandler:^(NSArray<CMMotionActivity *> * _Nullable activities, NSError * _Nullable error) {
57 57
     if (error != nil) {
58 58
       if (error.code == CMErrorNotAuthorized || error.code == CMErrorMotionActivityNotAuthorized) {
@@ -65,7 +65,7 @@ static NSString* handlerKey = @"motion";
65 65
     } else {
66 66
       resolve(RNPermissionStatusNotDetermined);
67 67
     }
68
-    
68
+
69 69
     self->_motionActivityManager = nil;
70 70
     self->_motionActivityQueue = nil;
71 71
   }];

+ 7
- 7
ios/PermissionHandlers/Notifications/RNPermissionHandlerNotifications.m 查看文件

@@ -23,7 +23,7 @@
23 23
     }];
24 24
   } else {
25 25
     UIUserNotificationSettings *settings = [[UIApplication sharedApplication] currentUserNotificationSettings];
26
-    
26
+
27 27
     if (settings == nil || settings.types == UIUserNotificationTypeNone) {
28 28
       resolve(RNPermissionStatusNotDetermined);
29 29
     } else {
@@ -40,21 +40,21 @@
40 40
 
41 41
     if (options != nil) {
42 42
       NSArray<NSString *> *notificationOptions = [options objectForKey:@"notificationOptions"];
43
-      
43
+
44 44
       if (notificationOptions != nil && [notificationOptions isKindOfClass:[NSArray class]]) {
45 45
 #if RCT_DEV
46 46
         // @TODO check if it's possible to use RCTConvert + RCT_ENUM_CONVERTER
47 47
         // https://developer.apple.com/documentation/usernotifications/unnotificationsettings?language=objc
48
-        
48
+
49 49
         NSArray<NSString *> *possible = [[NSArray alloc] initWithObjects:@"badge", @"sound", @"alert", @"carPlay", @"provisional", @"criticalAlert", nil];
50
-        
50
+
51 51
         for (NSString *option in notificationOptions) {
52 52
           if (![possible containsObject:option]) {
53 53
             return [RNPermissionsManager logErrorMessage:[NSString stringWithFormat:@"Invalid notificationOptions value : %@. Must be one of : %@.", option, [possible componentsJoinedByString:@", "]]];
54 54
           }
55 55
         }
56 56
 #endif
57
-        
57
+
58 58
         if ([notificationOptions containsObject:@"badge"]) {
59 59
           toRequest += UNAuthorizationOptionBadge;
60 60
         }
@@ -67,7 +67,7 @@
67 67
         if ([notificationOptions containsObject:@"carPlay"]) {
68 68
           toRequest += UNAuthorizationOptionCarPlay;
69 69
         }
70
-        
70
+
71 71
         if (@available(iOS 12.0, *)) {
72 72
           if ([notificationOptions containsObject:@"provisional"]) {
73 73
             toRequest += UNAuthorizationOptionProvisional;
@@ -82,7 +82,7 @@
82 82
         toRequest += UNAuthorizationOptionAlert;
83 83
       }
84 84
     }
85
-    
85
+
86 86
     [[UNUserNotificationCenter currentNotificationCenter] requestAuthorizationWithOptions:toRequest completionHandler:^(BOOL granted, NSError * _Nullable error) {
87 87
       if (error != nil) {
88 88
         reject(error);