Summary
In this chapter, you created a singleton, SharedData
, and configured your app to use it in place of the two separate SampleJournalEntryData
structures. Next, you modified the JournalEntry
class to be compatible with the JSON format, so you can save journal entries to a JSON file and load journal entries from a JSON file. After that, you added methods to save journal entry data when you add or delete journal entries, and to load journal entry data when your app is starting up.
You now know how to create a class to store, load, and save data from JSON files for use in your own apps.
In the next chapter, you’ll implement a custom user interface element that allows you to set star ratings for journal entries.
Learn more on Discord
To join the Discord community for this book – where you can share feedback, ask questions to the author, and learn about new releases – follow the QR code below: