Browse Source

Fix build errors in iOS native code

Fox 7 years ago
parent
commit
b36a997999
1 changed files with 6 additions and 6 deletions
  1. 6
    6
      ios/RNViewShot.m

+ 6
- 6
ios/RNViewShot.m View File

19
   return RCTGetUIManagerQueue();
19
   return RCTGetUIManagerQueue();
20
 }
20
 }
21
 
21
 
22
-RCT_EXPORT_METHOD(captureScreenshot: (NSDictionary *)options
22
+RCT_EXPORT_METHOD(captureScreen: (NSDictionary *)options
23
                   resolve:(RCTPromiseResolveBlock)resolve
23
                   resolve:(RCTPromiseResolveBlock)resolve
24
                   reject:(RCTPromiseRejectBlock)reject) 
24
                   reject:(RCTPromiseRejectBlock)reject) 
25
 {
25
 {
26
-  [captureRef -1, options, resolve, reject];
26
+  [self captureRef: [NSNumber numberWithInt:-1] withOptions:options resolve:resolve reject:reject];
27
 }
27
 }
28
 
28
 
29
 RCT_EXPORT_METHOD(releaseCapture:(nonnull NSString *)uri)
29
 RCT_EXPORT_METHOD(releaseCapture:(nonnull NSString *)uri)
48
     // Get view
48
     // Get view
49
     UIView *view;
49
     UIView *view;
50
 
50
 
51
-    if (target == -1) {
51
+    if ((int)target == -1) {
52
       UIWindow *window = [[UIApplication sharedApplication] keyWindow];
52
       UIWindow *window = [[UIApplication sharedApplication] keyWindow];
53
       view = window.rootViewController.view;
53
       view = window.rootViewController.view;
54
     } else {
54
     } else {
102
       scrollView.frame = CGRectMake(0, 0, scrollView.contentSize.width, scrollView.contentSize.height);
102
       scrollView.frame = CGRectMake(0, 0, scrollView.contentSize.width, scrollView.contentSize.height);
103
     }
103
     }
104
 
104
 
105
-    if (target == -1) {
105
+    if ((int)target == -1) {
106
       if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) {
106
       if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) {
107
-        UIGraphicsBeginImageContextWithOptions(currentView.window.bounds.size, NO, [UIScreen mainScreen].scale);
107
+        UIGraphicsBeginImageContextWithOptions(view.window.bounds.size, NO, [UIScreen mainScreen].scale);
108
       } else {
108
       } else {
109
-        UIGraphicsBeginImageContext(currentView.window.bounds.size);
109
+        UIGraphicsBeginImageContext(view.window.bounds.size);
110
       }
110
       }
111
     } else {
111
     } else {
112
       UIGraphicsBeginImageContextWithOptions(size, NO, 0);
112
       UIGraphicsBeginImageContextWithOptions(size, NO, 0);