 		}
 		
 		salesforce.authManager.loginCompleted(result: result)
-		if let window = self.window, let currentRootVC = window.rootViewController as? LoginViewController, let replacedRootVC = currentRootVC.replacedRootViewController {
+		if let window = self.window, let currentRootVC = window.rootViewController as? LoginViewControllerable, let replacedRootVC = currentRootVC.replacedRootViewController {
 			window.rootViewController = replacedRootVC
 		}
 	}

				() -> () in
				if let loginURL = try? salesforce.authManager.loginURL(), let window = self.window {
					// Replace current root view controller with Safari view controller for login
					let loginVC = LoginViewController(url: loginURL)
					loginVC.replacedRootViewController = window.rootViewController
					window.rootViewController = loginVC
				}
				fulfill()

			}
		}
	}
    
	func createLoginViewController(url loginURL:URL) -> UIViewController {
		return LoginViewController(url: loginURL)
	}
    
}
