Add Sign in with Apple to your app
In this new tutorial, I’ll show you how to add the Sign in with Apple option to your app.
Adding this new button is very simple :
Before starting this tutorail, make sure you’ve added the Sign in with Apple capability
- Import AuthenticationServices
- Create a function to add the button in your view
Don’t forget to call this function in the viewDidLoad()
- Add an action to the button
- Add an extenstion to tell what to do when the authentication is accepted or not
- Last thing, add a second extenstion to return the window you’re presenting
After that, you’re done adding Sign in with Apple. You can now get the user full name and email to save his account.
You can customize your button in three different ways
You have three different types:
.signUp displays “Sign in with Apple”
.continue displays “Continue with Apple”
You also have three differents styles:
.whiteOutline. See the guidelines for more informations.
You can customize the corner radius of the button from square to the maximum corner radius.
If you liked this tutorial, share it with your friends or should you have any feedback, contact me
All images: Apple