Created
June 12, 2019 14:35
-
-
Save yusufozgul/e1b7de6b9095265568fac3dc2b5bddd5 to your computer and use it in GitHub Desktop.
Sign in with Apple
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension ViewController: ASAuthorizationControllerDelegate, ASAuthorizationControllerPresentationContextProviding | |
{ | |
func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) | |
{ | |
guard let appleIDCredential = authorization.credential as? ASAuthorizationAppleIDCredential else { return } | |
print("USER: \(appleIDCredential.user)") | |
print("EMAIL: \(appleIDCredential.email!)") | |
print("FULL NAME: \(appleIDCredential.fullName!)") | |
} | |
func presentationAnchor(for controller: ASAuthorizationController) -> ASPresentationAnchor | |
{ | |
return self.view.window! | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment