Skip to content

Commit d99b8cb

Browse files
committed
Allow using a custom loading view
1 parent 08293d1 commit d99b8cb

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

ios/RCTSplashScreen/RCTSplashScreen/RCTSplashScreen.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ typedef NS_ENUM(NSInteger, RCTCameraAspect) {
1111

1212
+ (void)open:(RCTRootView *)v;
1313
+ (void)open:(RCTRootView *)v withImageNamed:(NSString *)imgName;
14+
+ (void)open:(RCTRootView *)v withLoadingView:(UIView *)loadingView;
1415

1516
@end

ios/RCTSplashScreen/RCTSplashScreen/RCTSplashScreen.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ + (void)open:(RCTRootView *)v withImageNamed:(NSString *)imageName {
3030
[rootView setLoadingView:view];
3131
}
3232

33+
+ (void)open:(RCTRootView *)v withLoadingView:(UIView *)loadingView {
34+
rootView = v;
35+
36+
[[NSNotificationCenter defaultCenter] removeObserver:rootView name:RCTContentDidAppearNotification object:rootView];
37+
38+
[rootView setLoadingView:loadingView];
39+
}
40+
3341
RCT_EXPORT_METHOD(close:(NSDictionary *)options) {
3442
if (!rootView) {
3543
return;

0 commit comments

Comments
 (0)