13

Saving Data in iOS [SUBSCRIBER]

 4 years ago
source link: https://www.raywenderlich.com/5429634-saving-data-in-ios
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Files & Data

Introduction

5:31 Free

Welcome to the Saving Data in iOS course! Find out what you'll learn, including FileManager, the Filesystem, URLs, Foundation Data and data types, and how to save and load data using files.

Familiarize yourself with FileManager and how to use it to retrieve the URL for the existing Document directory.

Paths

4:10

Learn how to add to a URL’s paths, and customize the files and filenames you use to save data with the URL you acquire.

Practice working with strings and URLs to create a path and filename where data would get stored to.

Learn about Foundation Data and the term “Data”. Also, familiarize yourself with the basics of Swift data types and structures like Integers, Floats, Doubles, Strings, Dictionaries, Sets, and Arrays.

Save and load data from an array into a binary file (without an extension), as well as a file with the .txt extension.

String

3:48

Save an array of integers, representing emoji, and also a string to file. Also, see how you're saving emoji to a text file both as bytes of data, or as string data.

Try to save a string to a file and read it back, this way you'll understand what happens behind the scenes when you use the "write" method on String.

Conclusion

0:59

You can now work with the FileManager, the Filesystem, and Data in order to save and load data from files in your app. In this episode, find out what's next!

JSON

Check out what you'll be learning in this part of the course, including JSON, its structure and types, saving and loading data using JSON, and Swift's Codable protocol.

Get an overview of JSON, what it means, the data format, and supported data types. Then, learn how to load, or decode, data from a JSON file.

Use the knowledge from the previous episode to load or decode via JSONDecoder, an array of JSON data.

In this episode, find out how to save files on a simulator or physical iOS device. Also, learn about the app bundle.

Save your JSON data to disk. This will mean the app is now loading and saving its data to the app bundle.

This challenge asks you to handle encoding an array of JSON data to a file, as opposed to encoding a single item.

Get a sense of how to encode/decode codable objects within each other. Also learn about CodingKeys and how to handle mapping different JSON properties to your Swift ones.

Conclusion

0:54

Let's review where you are with your JSON data-saving core concepts, and discuss what's next.

Property Lists

This part of the course includes learning about Property Lists, how they compare to JSON, and saving and loading data via PList files.

Cover the basics of Property Lists, .plist files, their difference with JSON, and the data types you can store in them.

Take on a challenge to see if you can save your existing JSON data into a property list file instead.

A back-to-back challenge where you attempt to now read back the property list file you saved in the previous episode.

Learn about the differences of working with JSON and Property Lists, pros and cons of each, and when you’d want to consider using them.

Conclusion

2:27

Congrats on finishing the course! Where can you take your skills now? Learn about next steps and further resources.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK