luanvuhlu
2/24/2016 - 1:24 AM

Set root view ios

Set root view ios

if let userToken = result.token {
  // Get user access token
  let token: FBSDKAccessToken = result.token
  let protectedPage = self.storyboard?.instantiateViewControllerWithIdentifier("ProtectedPageViewController") as! ProtectedPageViewController
  
  let protectedPageNav = UINavigationController(rootViewController: protectedPage)
  
  let appDelegate = UIApplication.shareApplication().delegate as! AppDelegate
  
  appDelegate.window?.rootViewController = protectedPageNav
}