Skip to content

Commit c4a3f96

Browse files
committed
Remove the need for a Bridging Header file
1 parent 6e2e222 commit c4a3f96

File tree

7 files changed

+12
-24
lines changed

7 files changed

+12
-24
lines changed

README.md

+5-11
Original file line numberDiff line numberDiff line change
@@ -189,25 +189,19 @@ type PluginOptions = {
189189

190190
#### iOS (react-native 0.77+)
191191

192-
Edit your [bridging header](https://developer.apple.com/documentation/swift/importing-objective-c-into-swift#Import-Code-Within-an-App-Target) file to expose Obj-C methods to Swift:
193-
194-
```obj-c
195-
//
196-
197-
// ⬇️ Add this import
198-
#import "RNBootSplash.h"
199-
```
200-
201192
Edit your `ios/YourApp/AppDelegate.swift` file:
202193

203194
```swift
195+
import ReactAppDependencyProvider
196+
import RNBootSplash // ⬅️ add this import
197+
204198
//
205199

206200
@main
207201
class AppDelegate: RCTAppDelegate {
208202
//
209203

210-
// ⬇️ Add this method
204+
// ⬇️ override this method
211205
override func customize(_ rootView: RCTRootView!) {
212206
super.customize(rootView)
213207
RNBootSplash.initWithStoryboard("BootSplash", rootView: rootView) // ⬅️ initialize the splash screen
@@ -221,7 +215,7 @@ Edit your `ios/YourApp/AppDelegate.mm` file:
221215

222216
```obj-c
223217
#import "AppDelegate.h"
224-
#import "RNBootSplash.h" // ⬅️ add the header import
218+
#import "RNBootSplash.h" // ⬅️ add this import
225219

226220
//
227221

RNBootSplash.podspec

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ Pod::Spec.new do |s|
1717
s.source = { :git => package["repository"]["url"], :tag => s.version }
1818
s.source_files = "ios/**/*.{h,m,mm}"
1919

20+
s.pod_target_xcconfig = { "DEFINES_MODULE" => "YES" }
21+
2022
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
2123
install_modules_dependencies(s)
2224
else
23-
s.dependency "React-Core"
25+
s.dependency "React-Core"
2426
end
2527
end

example/ios/Podfile.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -1499,7 +1499,7 @@ PODS:
14991499
- React-logger (= 0.77.0)
15001500
- React-perflogger (= 0.77.0)
15011501
- React-utils (= 0.77.0)
1502-
- RNBootSplash (6.3.2):
1502+
- RNBootSplash (6.3.3):
15031503
- DoubleConversion
15041504
- glog
15051505
- hermes-engine
@@ -1801,7 +1801,7 @@ SPEC CHECKSUMS:
18011801
ReactAppDependencyProvider: 6e8d68583f39dc31ee65235110287277eb8556ef
18021802
ReactCodegen: c08a5113d9c9c895fe10f3c296f74c6b705a60a9
18031803
ReactCommon: 1bd2dc684d7992acbf0dfee887b89a57a1ead86d
1804-
RNBootSplash: 9196ed6143d4993795a35822b1b9134c93f709e2
1804+
RNBootSplash: b83a1f87e0880ac30f9577d32cb046a081050d58
18051805
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
18061806
Yoga: 78d74e245ed67bb94275a1316cdc170b9b7fe884
18071807

example/ios/RNBootSplashExample.xcodeproj/project.pbxproj

-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
9606E3AD6F0E4A06B27CC2E3 /* BootSplash.storyboard */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = BootSplash.storyboard; path = RNBootSplashExample/BootSplash.storyboard; sourceTree = "<group>"; };
2727
C8B78429C105431082FBA2D4 /* Colors.xcassets */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = folder.assetcatalog; name = Colors.xcassets; path = RNBootSplashExample/Colors.xcassets; sourceTree = "<group>"; };
2828
DDFDB3882D401F2E00BABB04 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = RNBootSplashExample/AppDelegate.swift; sourceTree = "<group>"; };
29-
DDFDB3892D401F2E00BABB04 /* RNBootSplashExample-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "RNBootSplashExample-Bridging-Header.h"; path = "RNBootSplashExample/RNBootSplashExample-Bridging-Header.h"; sourceTree = "<group>"; };
3029
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
3130
/* End PBXFileReference section */
3231

@@ -51,7 +50,6 @@
5150
9606E3AD6F0E4A06B27CC2E3 /* BootSplash.storyboard */,
5251
13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */,
5352
DDFDB3882D401F2E00BABB04 /* AppDelegate.swift */,
54-
DDFDB3892D401F2E00BABB04 /* RNBootSplashExample-Bridging-Header.h */,
5553
);
5654
name = RNBootSplashExample;
5755
sourceTree = "<group>";
@@ -282,7 +280,6 @@
282280
);
283281
PRODUCT_BUNDLE_IDENTIFIER = com.zoontek.bootsplashexample;
284282
PRODUCT_NAME = RNBootSplashExample;
285-
SWIFT_OBJC_BRIDGING_HEADER = "RNBootSplashExample/RNBootSplashExample-Bridging-Header.h";
286283
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
287284
SWIFT_VERSION = 5.0;
288285
VERSIONING_SYSTEM = "apple-generic";
@@ -311,7 +308,6 @@
311308
);
312309
PRODUCT_BUNDLE_IDENTIFIER = com.zoontek.bootsplashexample;
313310
PRODUCT_NAME = RNBootSplashExample;
314-
SWIFT_OBJC_BRIDGING_HEADER = "RNBootSplashExample/RNBootSplashExample-Bridging-Header.h";
315311
SWIFT_VERSION = 5.0;
316312
VERSIONING_SYSTEM = "apple-generic";
317313
};

example/ios/RNBootSplashExample/AppDelegate.swift

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import UIKit
22
import React
33
import React_RCTAppDelegate
44
import ReactAppDependencyProvider
5+
import RNBootSplash
56

67
@main
78
class AppDelegate: RCTAppDelegate {

example/ios/RNBootSplashExample/RNBootSplashExample-Bridging-Header.h

-5
This file was deleted.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-bootsplash",
3-
"version": "6.3.2",
3+
"version": "6.3.3",
44
"license": "MIT",
55
"description": "Display a bootsplash on your app starts. Hide it when you want.",
66
"author": "Mathieu Acthernoene <[email protected]>",

0 commit comments

Comments
 (0)