We now that in monotouch and for iPhone / ipad application when we want to have splash screen before app lunch we should to set launch image in info.plist file and it will show this image before application launches.
But what is the best way to implement a splash screen when we want to have a splash that runs some heavy codes in background and not disappear until these operations had not completed? Some codes like downloading application config from internet and saving theme that often used in splash screen.
BTW, there is another solution: create main
UIViewController
, set it asWindow.RootViewController
immediately in AppDelegate'sFinishedLaunching
method. Then create and show modallysplashViewController
by this code:Hiding modal
UIViewController
is possible via calling code:Note that since iOS 6
PresentModalViewController
becomes deprecated method. So, for many iOS versions compatibility you could code special method for showing modalUIViewController
.Possible solution:
SplashViewController
, which contains same image as app's splash image. Also it containsUIActivityIndicatorView
;AppDelegate
's FinishedLaunching method make new instance ofSplashViewController
, set it aswindow.RootViewController
, call:window.RootViewController
to ViewController, which is app's starting point.