Skip to content

Commit b36a997

Browse files
author
Fox
committed
Fix build errors in iOS native code
1 parent 72e746e commit b36a997

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ios/RNViewShot.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ - (dispatch_queue_t)methodQueue
1919
return RCTGetUIManagerQueue();
2020
}
2121

22-
RCT_EXPORT_METHOD(captureScreenshot: (NSDictionary *)options
22+
RCT_EXPORT_METHOD(captureScreen: (NSDictionary *)options
2323
resolve:(RCTPromiseResolveBlock)resolve
2424
reject:(RCTPromiseRejectBlock)reject)
2525
{
26-
[captureRef -1, options, resolve, reject];
26+
[self captureRef: [NSNumber numberWithInt:-1] withOptions:options resolve:resolve reject:reject];
2727
}
2828

2929
RCT_EXPORT_METHOD(releaseCapture:(nonnull NSString *)uri)
@@ -48,7 +48,7 @@ - (dispatch_queue_t)methodQueue
4848
// Get view
4949
UIView *view;
5050

51-
if (target == -1) {
51+
if ((int)target == -1) {
5252
UIWindow *window = [[UIApplication sharedApplication] keyWindow];
5353
view = window.rootViewController.view;
5454
} else {
@@ -102,11 +102,11 @@ - (dispatch_queue_t)methodQueue
102102
scrollView.frame = CGRectMake(0, 0, scrollView.contentSize.width, scrollView.contentSize.height);
103103
}
104104

105-
if (target == -1) {
105+
if ((int)target == -1) {
106106
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);
108108
} else {
109-
UIGraphicsBeginImageContext(currentView.window.bounds.size);
109+
UIGraphicsBeginImageContext(view.window.bounds.size);
110110
}
111111
} else {
112112
UIGraphicsBeginImageContextWithOptions(size, NO, 0);

0 commit comments

Comments
 (0)