0

I'm trying to load 2 view controllers at the same time after the launchscreen.

Here's the stack I want to do:

SECOND VC - Currently being viewed

FIRST VC

Root VC

I did a workaround on it by calling presentViewController method under the viewDidAppear, but the result is the root vc is visible for a half second then the FIRST VC loads then finally loads the SECOND VC last.

The idea here is to have SECOND VC to be seen first then once dismissed it will slide down and shows the FIRST VC then hides to the ROOT VC last.

what methods should I use to accomplish this?

EDIT: Here's the example:

ROOT VC

override func viewDidAppear(animated: Bool){
let storyboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let firstVC: firstViewController = storyboard.instantiateViewControllerWithIdentifier("firstVC") as! firstViewController
        self.presentViewController(firstVC, animated: false, completion: nil)
}

FIRST VC

override func viewDidAppear(animated: Bool){
let storyboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let secondVC: secondViewController = storyboard.instantiateViewControllerWithIdentifier("secondVC") as! secondViewController
        self.presentViewController(secondVC, animated: false, completion: nil)
}

Then I would have a button on the SECOND VC and FIRST VC to dismiss it

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Renz Tan
  • 245
  • 3
  • 10

0 Answers0