Episode #546

Editing Text

Series: SwiftUI on the Mac

11 minutes
Published on February 9, 2023

This video is only available to subscribers. Get access to this video and 578 others.

To allow the user to edit the text elements, we'll add a binding for isEditing and swap out the Text element for a TextField. We'll then utilize onSubmit and a tap gesture to go in and out of the edit mode. Finally, using a derived binding, we can ensure that only one field is showing as editable at a given time.

This episode uses Xcode 14.2, Swift 5.7.