-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Changes in AppDelegate from Objective-C to Swift in React Native 0.77 and Above #667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
🚀 Consider Using Hey there! 👋 If you're facing issues with ✅ Why switch to
Check it out & give it a try! 🚀✨ |
how to use in old AppDelegate instead swift? |
umm...I was in a hurry, so I used react-native-bootsplash. |
No worries! React Native Bootsplash is also a solid choice. 😊 However, for future projects, I’d recommend checking out react-native-splash-view. It supports React Native 0.76+ with the new architecture, works seamlessly with both iOS & Android, and allows more flexibility in controlling the splash screen from native & JS sides. 🚀 Give it a look for your next project! 🎉 |
Found a way to work around the AppDelegate.swift changes in React Native 0.77 and above. As mentioned in the React Native 0.77 blog:
Since react-native-splash-screen doesn't support Swift currently, migrating back to Objective-C is an option for compatibility. Steps (using Xcode):
Updated
|
What worked for me was using a bridging header while doing the migration to Swift. You can check it out here. |
Thanks for the tip! Would you mind sharing how you did it exactly? That would really help a lot. 🙏 |
change:AppDelegate.swiftoverride func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
} add:RNSplashScreenHelper.h#ifndef RNSplashScreenHelper_h #import <Foundation/Foundation.h> @interface RNSplashScreenHelper : NSObject
#endif /* RNSplashScreenHelper_h */ add:RNSplashScreenHelper.m#import "RNSplashScreenHelper.h"
add your project name-Bridging-Header.h#import "RNSplashScreenHelper.h" |
Since React Native version 0.77, the AppDelegate has been changed from Objective-C to Swift for iOS projects. This means that your import statements and setup might need to be adjusted accordingly.
Can you tell me when these changes will be applied?
The text was updated successfully, but these errors were encountered: