1
votes

I changed "Launch Screen File" to my "Main.Storyboard" in settings. Before doing this app was working fine, and opened directly without any problem. But after adding this there was a black screen before the launch of storyboard. This is very bad user experience. Help me to solve this. AppDelegate and viewController has nothing big. I have a LaunchScreen.xib in project and also LaunchImage in image assets. I am using Storyboard in project. I don't want a launchScreen in my app, I just wanna directly go to my storyboard.

    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {

 self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
        self.window?.rootViewController = utilitiesObjet.getViewController("MainVC", mainStoryBoardName: "Main")
        self.window?.makeKeyAndVisible()

        Fabric.with([Crashlytics.self()])

        return true
    }

enter image description here

I solved it by adding a LaunchScreen.StoryBoard, Instead of using a LaunchScreen.xib. Thank you All :)

2
what r you use....xib ya storyboard in project... ?Maulik shah
I am using StoryboardAlvin Varghese
This may be because there is an outlet on your storyboard's initial view cotroller, which will cause nothing to render. Nothing will also happen if your initial view controller is a navigation controller.Matt Le Fleur

2 Answers

1
votes

use this code in appdelegate this code for objective c .....did finish launching with option method...

        self.winow = [[UIWindow alloc]initWithFrame:[[UIScreen mainScreen]bounds]];

        UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"<Your Storyboard name>" bundle:nil];
        LoginViewController *ivc = [storyboard instantiateViewControllerWithIdentifier:@"<your view controller storyboard identifer name>"];
        UINavigationController *navigationController=[[UINavigationController alloc] initWithRootViewController:ivc];

        self.window.rootViewController = navigationController;
        [self.window makeKeyAndVisible];

For Swift....

 func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool
{
    // Override point for customization after application launch.
    let storyboard:UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
    let navigationController:UINavigationController = storyboard.instantiateInitialViewController() as UINavigationController
    let rootViewController:UIViewController = storyboard.instantiateViewControllerWithIdentifier("VC") as UIViewController
    navigationController.viewControllers = [rootViewController]
    self.window?.rootViewController = navigationController
    return true
}
0
votes

Launch Screen different Main.StoryBoard. In Launch Screen File, you must type: "LaunchScreen" and choose file Lscreen.storyboard (xcode7), or .xib if Xcode6