Skip to content

Latest commit

 

History

History
69 lines (35 loc) · 1.44 KB

ios-installation.md

File metadata and controls

69 lines (35 loc) · 1.44 KB

Getting Started Ios

Install the library using either Yarn:

yarn add rnative-splash

(or)

For npm use

npm install rnative-splash --save

If using cocoapods in the ios/ directory run

cd ios
pod install

NOTE: If you ever need to uninstall rnative-splash, run react-native unlink rnative-splash to unlink it.

Installation (Ios)

This line is [RCTSplashScreen open: rootView withImageNamed: @" splash "]; Add before the rootView.backgroundColor line.

In AppDelegate.m

...
#import "RCTSplashScreen.h" //import interface
...

[RCTSplashScreen open:rootView withImageNamed:@"splash"]; // <-- activate splash, imagename from LaunchScreen.xib

rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];

... 

return YES

Xcode Steps

The following changes are required for xcode.

Step 1

Delete your project's LaunchScreen.xib

Step 2

Let's move the SplashScreenResource folder under the ios/ folder.

cp -R ./node_modules/rnative-splash/ios/SplashScreenResource ios/

Drag SplashScreenResource folder to your project if you want change image, replace splash.png or add a image with your custom name.

--

it's that simple 🎉🎉🎉🎉🎉🎉🎉

You can continue to Usage it here.