From 81702377c377e4ed4ee82271ccf909d6b1ff496b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Kwas=CC=81niewski?= Date: Mon, 2 Dec 2024 12:42:01 +0100 Subject: [PATCH] fix(iOS): use bridging header, remove utils wrapper --- .../react-native-fast-io/ios/BridgingHeader.h | 1 + .../ios/FastIOPrivate/module.modulemap | 2 +- .../ios/HybridFileSystem.swift | 2 +- .../react-native-fast-io/ios/RCTUtilsWrapper.h | 5 ----- .../react-native-fast-io/ios/RCTUtilsWrapper.m | 15 --------------- 5 files changed, 3 insertions(+), 22 deletions(-) create mode 100644 packages/react-native-fast-io/ios/BridgingHeader.h delete mode 100644 packages/react-native-fast-io/ios/RCTUtilsWrapper.h delete mode 100644 packages/react-native-fast-io/ios/RCTUtilsWrapper.m diff --git a/packages/react-native-fast-io/ios/BridgingHeader.h b/packages/react-native-fast-io/ios/BridgingHeader.h new file mode 100644 index 0000000..c72830a --- /dev/null +++ b/packages/react-native-fast-io/ios/BridgingHeader.h @@ -0,0 +1 @@ +#import diff --git a/packages/react-native-fast-io/ios/FastIOPrivate/module.modulemap b/packages/react-native-fast-io/ios/FastIOPrivate/module.modulemap index aa35e24..12cec8a 100644 --- a/packages/react-native-fast-io/ios/FastIOPrivate/module.modulemap +++ b/packages/react-native-fast-io/ios/FastIOPrivate/module.modulemap @@ -1,5 +1,5 @@ module FastIOPrivate { - header "../RCTUtilsWrapper.h" + header "../BridgingHeader.h" header "../../cpp/Constants.h" export * } diff --git a/packages/react-native-fast-io/ios/HybridFileSystem.swift b/packages/react-native-fast-io/ios/HybridFileSystem.swift index 26a3826..b65b8fa 100644 --- a/packages/react-native-fast-io/ios/HybridFileSystem.swift +++ b/packages/react-native-fast-io/ios/HybridFileSystem.swift @@ -78,7 +78,7 @@ class HybridFileSystem : NSObject, UIDocumentPickerDelegate, HybridFileSystemSpe documentPicker.directoryURL = URL(fileURLWithPath: startIn, isDirectory: true) } - guard let vc = RCTUtilsWrapper.getPresentedViewController() else { + guard let vc = RCTPresentedViewController() else { promise.reject(withError: RuntimeError.error(withMessage: "Cannot present file picker")) return } diff --git a/packages/react-native-fast-io/ios/RCTUtilsWrapper.h b/packages/react-native-fast-io/ios/RCTUtilsWrapper.h deleted file mode 100644 index b612ded..0000000 --- a/packages/react-native-fast-io/ios/RCTUtilsWrapper.h +++ /dev/null @@ -1,5 +0,0 @@ -#import - -@interface RCTUtilsWrapper : NSObject -+ (UIViewController *)getPresentedViewController; -@end diff --git a/packages/react-native-fast-io/ios/RCTUtilsWrapper.m b/packages/react-native-fast-io/ios/RCTUtilsWrapper.m deleted file mode 100644 index 2f2b402..0000000 --- a/packages/react-native-fast-io/ios/RCTUtilsWrapper.m +++ /dev/null @@ -1,15 +0,0 @@ -// -// RCTUtilsWrapper.m -// FastIO -// -// Created by Mike Grabowski on 10/11/2024. -// - -#import "RCTUtilsWrapper.h" -#import - -@implementation RCTUtilsWrapper -+ (UIViewController *)getPresentedViewController { - return RCTPresentedViewController(); -} -@end