diff --git a/ios/RCTWebViewBridge.h b/ios/RCTWebViewBridge.h index 09006303..77c8c00f 100644 --- a/ios/RCTWebViewBridge.h +++ b/ios/RCTWebViewBridge.h @@ -10,7 +10,16 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -#import "RCTView.h" + /** + * Fix compile error for RN version > 0.40 + */ + #if __has_include() + #import + #elif __has_include("RCTView.h") + #import "RCTView.h" + #else + #import "React/RCTView.h" + #endif @class RCTWebViewBridge; diff --git a/ios/RCTWebViewBridge.m b/ios/RCTWebViewBridge.m index ce7868c4..b9e4e260 100644 --- a/ios/RCTWebViewBridge.m +++ b/ios/RCTWebViewBridge.m @@ -10,18 +10,36 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -#import "RCTWebViewBridge.h" - -#import - -#import "RCTAutoInsetsProtocol.h" -#import "RCTConvert.h" -#import "RCTEventDispatcher.h" -#import "RCTLog.h" -#import "RCTUtils.h" -#import "RCTView.h" -#import "UIView+React.h" -#import + #import "RCTWebViewBridge.h" + + #import + + #if __has_include() + #import + #import + #import + #import + #import + #import + #import + #elif __has_include("RCTAutoInsetsProtocol.h") + #import "RCTAutoInsetsProtocol.h" + #import "RCTConvert.h" + #import "RCTEventDispatcher.h" + #import "RCTLog.h" + #import "RCTUtils.h" + #import "RCTView.h" + #import "UIView+React.h" + #else + #import "React/RCTAutoInsetsProtocol.h" + #import "React/RCTConvert.h" + #import "React/RCTEventDispatcher.h" + #import "React/RCTLog.h" + #import "React/RCTUtils.h" + #import "React/RCTView.h" + #import "React/UIView+React.h" + #endif + #import //This is a very elegent way of defining multiline string in objective-c. //source: http://stackoverflow.com/a/23387659/828487 diff --git a/ios/RCTWebViewBridgeManager.h b/ios/RCTWebViewBridgeManager.h index e0659a8d..376a1323 100644 --- a/ios/RCTWebViewBridgeManager.h +++ b/ios/RCTWebViewBridgeManager.h @@ -10,7 +10,13 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -#import "RCTViewManager.h" + #if __has_include() + #import + #elif __has_include("RCTViewManager.h") + #import "RCTViewManager.h" + #else + #import "React/RCTViewManager.h" + #endif @interface RCTWebViewBridgeManager : RCTViewManager diff --git a/ios/RCTWebViewBridgeManager.m b/ios/RCTWebViewBridgeManager.m index ad15e14b..88f89bb8 100644 --- a/ios/RCTWebViewBridgeManager.m +++ b/ios/RCTWebViewBridgeManager.m @@ -10,12 +10,22 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -#import "RCTWebViewBridgeManager.h" - -#import "RCTBridge.h" -#import "RCTUIManager.h" -#import "RCTWebViewBridge.h" -#import "UIView+React.h" + #import "RCTWebViewBridge.h" + #import "RCTWebViewBridgeManager.h" + + #if __has_include() + #import + #import + #import + #elif __has_include("RCTBridge.h") + #import "RCTBridge.h" + #import "RCTUIManager.h" + #import "UIView+React.h" + #else + #import "React/RCTBridge.h" + #import "React/RCTUIManager.h" + #import "React/UIView+React.h" + #endif @interface RCTWebViewBridgeManager ()