I tried this solution but I get an error AnyObject is not convertible to 'UIViewController' did you mean to use 'as!' to force downcast?
What am I doing wrong?
I call the following code in LoginViewController viewDidLoad, I check if the user has logged in yet if yes then I want to skip the login view and go directly to Latest Photos which is FirstViewController...
override func viewDidLoad() {
super.viewDidLoad()
if(defaults.objectForKey("loggedIn") != nil){
let vc : UIViewController = self.storyboard?.instantiateViewControllerWithIdentifier("LatestPhotosView") as! UIViewController;
self.presentViewController(vc, animated: true, completion: nil)
}
}