Skip to content
Permalink
Browse files
CB-10412 AutoHideSplashScreen "false" isn't taken in account on iOS
  • Loading branch information
daserge committed Jan 27, 2016
1 parent 799b0a1 commit 109c82b29b6cfda4fabcd0aa9a7660954b50e7d6
Showing with 21 additions and 1 deletion.
  1. +21 −1 src/ios/CDVSplashScreen.m
@@ -388,6 +388,19 @@ - (void)setVisible:(BOOL)visible
id splashDurationString = [self.commandDelegate.settings objectForKey: [@"SplashScreenDelay" lowercaseString]];
float splashDuration = splashDurationString == nil ? kSplashScreenDurationDefault : [splashDurationString floatValue];

id autoHideSplashScreenValue = [self.commandDelegate.settings objectForKey:[@"AutoHideSplashScreen" lowercaseString]];
BOOL autoHideSplashScreen = true;

if (autoHideSplashScreenValue != nil) {
autoHideSplashScreen = [autoHideSplashScreenValue boolValue];
}

if (!autoHideSplashScreen) {
// CB-10412 SplashScreenDelay does not make sense if the splashscreen is hidden manually
splashDuration = 0;
}


if (fadeSplashScreenValue == nil)
{
fadeSplashScreenValue = @"true";
@@ -418,7 +431,14 @@ - (void)setVisible:(BOOL)visible
else
{
__weak __typeof(self) weakSelf = self;
float effectiveSplashDuration = (splashDuration - fadeDuration) / 1000;
float effectiveSplashDuration;

if (!autoHideSplashScreen) {
effectiveSplashDuration = (fadeDuration) / 1000;
} else {
effectiveSplashDuration = (splashDuration - fadeDuration) / 1000;
}

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (uint64_t) effectiveSplashDuration * NSEC_PER_SEC), dispatch_get_main_queue(), CFBridgingRelease(CFBridgingRetain(^(void) {
[UIView transitionWithView:self.viewController.view
duration:(fadeDuration / 1000)

0 comments on commit 109c82b

Please sign in to comment.