Skip to content

Instantly share code, notes, and snippets.

@GantMan
Created September 5, 2012 21:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GantMan/3644690 to your computer and use it in GitHub Desktop.
Save GantMan/3644690 to your computer and use it in GitHub Desktop.
class AppDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
@window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
@window.rootViewController = RootController.alloc.init
#Splash Screen
image_view = UIImageView.alloc.initWithImage(UIImage.imageNamed("Default.png"))
@window.rootViewController.view.addSubview(image_view)
@window.rootViewController.view.bringSubviewToFront(image_view)
# normal
@window.makeKeyAndVisible
# fade out splash image
fade_out_timer = 1.0
UIView.transitionWithView(@window, duration:fade_out_timer, options:UIViewAnimationOptionTransitionNone, animations: lambda {image_view.alpha = 0}, completion: lambda do |finished|
image_view.removeFromSuperview
image_view = nil
UIApplication.sharedApplication.setStatusBarHidden(false, animated:false)
end)
true
end
end
@buk
Copy link

buk commented Nov 21, 2012

Hi,

first off all thanks for sharing. This is great piece of code. I have only one problem, when the Splash Screen fades out the Navigation Bar is half hidden behind the Status Bar.

I am using your code within a TabbarApplication. Do you have any ideas what is going wrong there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment