diff --git a/ios/RCTSplashScreen/RCTSplashScreen/RCTSplashScreen.h b/ios/RCTSplashScreen/RCTSplashScreen/RCTSplashScreen.h index 651b3f5..26684ed 100644 --- a/ios/RCTSplashScreen/RCTSplashScreen/RCTSplashScreen.h +++ b/ios/RCTSplashScreen/RCTSplashScreen/RCTSplashScreen.h @@ -11,5 +11,6 @@ typedef NS_ENUM(NSInteger, RCTCameraAspect) { + (void)open:(RCTRootView *)v; + (void)open:(RCTRootView *)v withImageNamed:(NSString *)imgName; ++ (void)open:(RCTRootView *)v withLoadingView:(UIView *)loadingView; @end diff --git a/ios/RCTSplashScreen/RCTSplashScreen/RCTSplashScreen.m b/ios/RCTSplashScreen/RCTSplashScreen/RCTSplashScreen.m index 278fefd..ea728f2 100644 --- a/ios/RCTSplashScreen/RCTSplashScreen/RCTSplashScreen.m +++ b/ios/RCTSplashScreen/RCTSplashScreen/RCTSplashScreen.m @@ -30,6 +30,14 @@ + (void)open:(RCTRootView *)v withImageNamed:(NSString *)imageName { [rootView setLoadingView:view]; } ++ (void)open:(RCTRootView *)v withLoadingView:(UIView *)loadingView { + rootView = v; + + [[NSNotificationCenter defaultCenter] removeObserver:rootView name:RCTContentDidAppearNotification object:rootView]; + + [rootView setLoadingView:loadingView]; +} + RCT_EXPORT_METHOD(close:(NSDictionary *)options) { if (!rootView) { return; diff --git a/react-native-smart-splash-screen.podspec b/react-native-smart-splash-screen.podspec new file mode 100644 index 0000000..a756a5c --- /dev/null +++ b/react-native-smart-splash-screen.podspec @@ -0,0 +1,22 @@ +require 'json' + +package = JSON.parse(File.read(File.join(__dir__, 'package.json'))) + +Pod::Spec.new do |s| + s.name = 'react-native-smart-splash-screen' + s.version = package['version'] + s.summary = package['description'] + s.description = package['description'] + s.license = package['license'] + s.author = package['author'] + s.homepage = package['homepage'] + s.source = { :git => 'https://github.com/react-native-component/react-native-smart-splash-screen', :tag => s.version } + + s.requires_arc = true + s.platform = :ios, '8.0' + + s.preserve_paths = 'LICENSE', 'README.md', 'package.json', 'index.js' + s.source_files = 'ios/**/*.{h,m}' + + s.dependency 'React' +end