How to save a file in Swift

Опубликовано: 02 Апрель 2026
на канале: James Abela
1,121
6

HUGE UPDATE: It's now much easier to save files. Please see the new video:    • How to Save your data in Swift automatically  
(Works in Swift 4.1 and above)


My code still works, so do feel free to follow along.

This video shows you how to save in Swift Playground 4.1. The demo includes the full code for a Notepad app to give you a real demonstration of what you can do.

0:00 Intro
0:33 Setup keys for saving
0:55 Loading previous values
2:21 Save button
3:00 Detailed guide to the commands


Gist is at: https://gist.github.com/jamesabela/8a...

This is intended for beginners and if you need to save larger amounts of data, then it is worth investing the time to learn how to use databases.