Edit Data with SwiftUI & SwiftData | Create Reusable View with SwiftUI - 5/9

Опубликовано: 29 Март 2026
на канале: Think Like an Engineer
328
11

In this video, we’ll learn how to edit data in our Vocabulary Notebook App using SwiftUI and SwiftData. We’ll create an EditWordView to modify saved words and apply changes instantly.

What You’ll Learn:
✅ How to reuse a form in NewWordView and EditWordView for better maintainability
✅ Using SwiftData’s AutoSave to automatically update changes
✅ Implementing an edit feature
✅ Sync data instantly

We’ll walk through step-by-step, from creating a FormView to integrating it into NewWordView and EditWordView, ensuring a seamless editing experience.

Previous Videos for the Sample App:
📌    • Insert Data with SwiftData & SwiftUI - 1/9  
📌    • Query Data with SwiftData | Get All Data, ...  
📌    • Navigate between Views using NavigationLin...  
📌    • Provide Sample Data for SwiftUI Previews |...  

You may find these videos helpful:
📌    • How to Install a Simulator on Xcode | iPho...  
📌    • Persist Data using SwiftData with Relation...  
📌    • How to Animate and Color Icons in your App...  

Chapters:
00:00 Introduction
00:18 Recap of the Sample App
02:02 Create Reusable FormView
03:49 Reorganize NewWordView using Reusable FormView
04:57 Prepare sheet to open EditWordView
06:19 Create EditWordView using Reusable FormView
07:25 Close the EditWordView sheet with button using State/Binding Variable
08:48 SwiftData AutoSave for editing
09:42 Close the NewWordView sheet with button using State/Binding Variable
10:57 Overall flow of the app

👍 If this video helped you, don’t forget to like, share, and subscribe for more iOS app development tutorials, tips, and tricks!

🔔 Turn on notifications so you never miss an update!

#SwiftUI #SwiftData #IOSApp #Edit