I am trying to call upon the root controller and I don't know the code to call upon it. I'm using a conditional and which will check what the previous view controller was, and a block of code will run depending on what it was. Here is my code:
SecondViewController
override func viewDidLoad ( ) {
super.viewDidLoad ( )
let previousController = storyboard!.instantiateViewControllerWithIdentifier ("firstViewController") as? FirstViewController
//HELP IN LINE BELOW
//if root view controller == previousController {
//run some code
//}
}