7
7
// this header file is generated by Xcode: https://developer.apple.com/documentation/swift/importing-swift-into-objective-c
8
8
// if it cannot be found, try cleaning the build folder and Xcode derived data folder
9
9
10
- // When using use_frameworks! :linkage => :static in Podfile
11
- #if __has_include(<react_native_document_picker/react_native_document_picker-Swift.h>)
10
+ // Import Swift module header with multiple fallback options
11
+ #if __has_include("react_native_document_picker-Swift.h")
12
+ #import " react_native_document_picker-Swift.h"
13
+ #elif __has_include(<react_native_document_picker/react_native_document_picker-Swift.h>)
12
14
#import < react_native_document_picker/react_native_document_picker-Swift.h>
15
+ #elif __has_include("react-native-document-picker-Swift.h")
16
+ #import " react-native-document-picker-Swift.h"
17
+ #elif __has_include(<react-native-document-picker/react-native-document-picker-Swift.h>)
18
+ #import < react-native-document-picker/react-native-document-picker-Swift.h>
13
19
#else
14
- #import " react_native_document_picker- Swift.h "
20
+ #warning " Swift bridging header not found. Make sure Swift files are compiled and module is properly configured. "
15
21
#endif
16
22
17
23
@interface RNDocumentPicker ()
@@ -44,7 +50,7 @@ + (BOOL)requiresMainQueueSetup {
44
50
(RCTPromiseRejectBlock) reject)
45
51
{
46
52
PickerOptions *pickerOptions = [RCTConvert PickerOptions: options];
47
- [docPicker present : pickerOptions resolve: resolve reject: reject];
53
+ [docPicker presentWithOptions : pickerOptions resolve: resolve reject: reject];
48
54
}
49
55
50
56
RCT_EXPORT_METHOD (pickDirectory:
@@ -55,7 +61,8 @@ + (BOOL)requiresMainQueueSetup {
55
61
(RCTPromiseRejectBlock) reject)
56
62
{
57
63
PickerOptions *pickerOptions = [RCTConvert PickerOptions: options];
58
- [docPicker presentDirectory: pickerOptions resolve: resolve reject: reject];
64
+ pickerOptions.isDirectoryPicker = YES ;
65
+ [docPicker presentWithOptions: pickerOptions resolve: resolve reject: reject];
59
66
}
60
67
61
68
RCT_EXPORT_METHOD (saveDocument:
@@ -66,7 +73,7 @@ + (BOOL)requiresMainQueueSetup {
66
73
(RCTPromiseRejectBlock) reject)
67
74
{
68
75
SaverOptions *saverOptions = [RCTConvert SaverOptions: options];
69
- [docSaver present : saverOptions resolve: resolve reject: reject];
76
+ [docSaver presentWithOptions : saverOptions resolve: resolve reject: reject];
70
77
}
71
78
72
79
RCT_EXPORT_METHOD (releaseSecurityScopedResource:
0 commit comments