Authentication Using SwiftUI

Who are you, again?

Steven Curtis

--

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

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:

Create a new SwiftUI App, of course change the product name though!

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.

The credentials

--

--