Member-only story

What is a ProjectedValue in SwiftUI?

Kind of what is sounds like

Steven Curtis
5 min readApr 4, 2023
Photo by Eduardo Goody on Unsplash

Before we start

Difficulty: Beginner | Easy | Normal | Challenging

This article has been developed using Xcode 12.2, and Swift 5.3

Prerequisites

Keywords and Terminology

Binding: The mapping of one thing to another.

projectedValue: A projection of the binding value that returns a binding.

State: A property wrapper type that can read and write a value managed by SwiftUI.

String: A collection of Characters.

Text: A view that displays one or more lines of read-only text.

TextField: A control that displays an editable text interface.

This project

Background

Apple’s documentation is actually rather nice for this, but does rely on the reader understanding @State and Binding, and doesn’t give a repo with code that can be downloaded and run on your local machine.

The non-working illustrative version

--

--

No responses yet