Authentication Using SwiftUI
Who are you, again?
Before we start
Difficulty: Beginner | Easy | Normal | Challenging
The opportunity
You know what, I’ve previously had a fun old time creating a Tip calculator in SwiftUI. Yes, there are some points for improvements (thanks all commenters on all my articles).
The completed project
The supporting video
Prerequisites
- You need to be able to use SwiftUI, perhaps in a Playground
- I am including use of my Network Manager in this project
Keywords and Terminology
ObservableObject: A type of object with a publisher that emits before the object has changed
SwiftUI: A simple way to build user interfaces across Apple platforms
Setting up the project
This project does have much to do with my SwiftUI tip calculator project, and in fact the setup is the same
We can create a new SwiftUI project, and here we are using the SwiftUI template to do so:
We also take the same approach to the initializing the ViewModel and View:
which then opens the door to being able to login, using jsonplaceholder.typicode.com
and their /api/login
login.