Sangam Shankar
Sangam Shankar

Reputation: 43

How to add transition from launch screen to initial view controller ios?

I have two storyboards.

  1. LaunchScreen.storyboard (has a simple LaunchScreen with a label)
  2. Main.storyboard (Has one view controller(HomeScreen) with a label)

When the app loads, LaunchScreen shows and immediately presents HomeScreen with fade in transition. Is there anyway I could change this transition?

I have tried following things

  1. Set window?.rootViewController?.modalTransitionStyle in AppDelegate(didFinishLaunchingWithOptions).
  2. Set window?.rootViewController?.transitioningDelegate.
  3. Tried to add a custom view controller to LaunchScreen gives an error:"Launch screens may not set custom classnames".

Upvotes: 2

Views: 4837

Answers (1)

Jim
Jim

Reputation: 73936

Create a new view controller that just shows the launch screen identically to how it looks when it's being launched. Set that to be your initial view controller. Transition from that view controller to your home view controller.

Upvotes: 3

Related Questions