Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save actuosus/0491b8219dc787604098fb20dfd7e494 to your computer and use it in GitHub Desktop.
Save actuosus/0491b8219dc787604098fb20dfd7e494 to your computer and use it in GitHub Desktop.
Patch file to compile react-native-image-crop-picker with Xcode 10
diff --git a/node_modules/react-native-image-crop-picker/ios/QBImagePicker/QBImagePicker/QBAssetsViewController.m b/node_modules/react-native-image-crop-picker/ios/QBImagePicker/QBImagePicker/QBAssetsViewController.m
index 0a9fddb..865854b 100644
--- a/node_modules/react-native-image-crop-picker/ios/QBImagePicker/QBImagePicker/QBAssetsViewController.m
+++ b/node_modules/react-native-image-crop-picker/ios/QBImagePicker/QBImagePicker/QBAssetsViewController.m
@@ -194,9 +194,11 @@ - (void)setUpToolbarItems
// Info label
UIColor *labelColor = [UIColor blackColor];
+ #ifdef __IPHONE_13_0
if (@available(iOS 13.0, *)) {
labelColor = [UIColor labelColor];
}
+ #endif
NSDictionary *attributes = @{ NSForegroundColorAttributeName: labelColor };
UIBarButtonItem *infoButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:NULL];
infoButtonItem.enabled = NO;
diff --git a/node_modules/react-native-image-crop-picker/ios/QBImagePicker/QBImagePicker/QBAssetsViewController.m b/node_modules/react-native-image-crop-picker/ios/QBImagePicker/QBImagePicker/QBAssetsViewController.m
index 0a9fddb..865854b 100644
--- a/node_modules/react-native-image-crop-picker/ios/QBImagePicker/QBImagePicker/QBAssetsViewController.m
+++ b/node_modules/react-native-image-crop-picker/ios/QBImagePicker/QBImagePicker/QBAssetsViewController.m
@@ -194,9 +194,11 @@ - (void)setUpToolbarItems
// Info label
UIColor *labelColor = [UIColor blackColor];
+ #ifdef __IPHONE_13_0
if (@available(iOS 13.0, *)) {
labelColor = [UIColor labelColor];
}
+ #endif
NSDictionary *attributes = @{ NSForegroundColorAttributeName: labelColor };
UIBarButtonItem *infoButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:NULL];
infoButtonItem.enabled = NO;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment