Thread 1: Signal SIGABRT (Could not cast value of type to 'SignInViewController' to 'AWSCognitoIdentityPasswordAuthentication')

223 views Asked by At

So far when after completing the username and password fields in my SignInViewController.

This is what the code looks like:

Code from SignInViewControllerExtension class

func startPasswordAuthentication() -> AWSCognitoIdentityPasswordAuthentication {
        return self as! AWSCognitoIdentityPasswordAuthentication
}

My SignInViewControllerExtensions throws a Thread 1: Signal SIGABRT error with the following message in the debug area:

Could not cast value of type 'Elixr.SignInViewController' (0x1001460a8) to 'AWSCognitoIdentityPasswordAuthentication' (0x100134468).

1

There are 1 answers

3
Mike JS Choi On BEST ANSWER

You're probably trying to assign Elixr.SignInViewController as AWSCognitoIdentityPasswordAuthentication somewhere. But I can't say more without looking at the actual code.

But I'm guessing it's going to look something like this...

let someVc = SignInViewController(args_here) as! AWSCognitoIdentityPasswordAuthentication

The as! above is trying to force cast something that is not AWSCognito... so the code is going to crash.