I am using ParseUI inside a SpriteKit Swift app.
This is my LoginScene
class LoginScene: SKScene, PFLogInViewControllerDelegate, PFSignUpViewControllerDelegate {
func showLoginView() {
let nativeLogin = NativeLoginViewController()
nativeLogin.fields = PFLogInFields.Default
nativeLogin.delegate = self
self.view?.window?.rootViewController?.presentViewController(nativeLogin, animated: true, completion: nil)
}
func logInViewController(logInController: PFLogInViewController!, didLogInUser user: PFUser!) {
println("login succeeded")
self.view?.window?.rootViewController?.dismissViewControllerAnimated(true, completion: {() in
println("dismissed loginviewcontroller suceeded")
self.view?.presentScene(ModeMenuScene(size: self.view!.bounds.size))
})
}
}
}
It does print login succeeded
but not dismissed loginviewcontroller succeeded
. How can I dismiss the loginview upon login and go back to my LoginScene ?
Found the solution : I need to make use of the first parameter instead of relying on the delegate controller.