Implementing delegate methods and button actions

Now, your app is displaying a Sign in with Apple button on the screen when it is launched, but it doesn't work yet. To implement the functionality of the Sign in with Apple button, you'll need to make SignInViewController conform to the ASAuthorizationControllerDelegate and ASAuthorizationControllerPresentationContextProviding protocols.

ASAuthorizationControllerDelegate has two optional methods that you will implement:

  • authorizationController(controller: didCompleteWithAuthorization:): This will be executed if the user enters the correct Apple ID and password.
  • authorizationController(controller: didCompleteWithError:): This will be executed if the process was unsuccessful.

ASAuthorizationControllerPresentationContextProviding ...

Get iOS 13 Programming for Beginners - Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.