How to do IS with an objective C class?

  

I try to convert this ios/objective-c function under delphi Rio 10.3.3

func authorizationController(authorization: ASAuthorization) {
if let appleIDCredential = authorization.credential as? ASAuthorizationAppleIDCredential {

} else if let passwordCredential = authorization.credential as? ASPasswordCredential {

}
}

I set authorization.credential to be a pointer. Now my problem how with this pointer can I check the IS ASAuthorizationAppleIDCredential before to cast like for example :

if authorization.credential IS ASAuthorizationAppleIDCredential then
TASAuthorizationAppleIDCredential.wrap(authorization.credential);

Comments are closed.