0

Hi, I'm new to react native technology and i'm trying to create splash screen for iOS by using this steps in following link

React Native Splash Screen (iOS)

and i got this error as attached image

SplashScreen

Please any advice.

Haya
  • 13
  • 1
  • 3

1 Answers1

5

In react-native-splash-screen lib readme.md is not updated. So what you need to change is your AppDelegate.m & RNSplashScreen.m file. see the below code.

#import "SplashScreen.h" //replace this with #import "RNSplashScreen.h"
[SplashScreen show]; //replace this with [RNSplashScreen show];

In RNSplashScreen.m

//Replace this with below code
RCT_EXPORT_METHOD(show) {   
    [SplashScreen show];
}

//Add this in place of above code.
RCT_EXPORT_METHOD(show) {
[RNSplashScreen show];
}

//Add below path to search path.
//To fix 'RNSplashScreen.h' file not found, you have to select your project → //Build Settings → Search Paths → Header Search Paths to add:

$(SRCROOT)/../node_modules/react-native-splash-screen/ios

Happy coding :)

Codesingh
  • 3,316
  • 1
  • 11
  • 18