Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
iOS 26 Programming for Beginners

You're reading from   iOS 26 Programming for Beginners A hands-on guide to kickstarting your iOS app development journey with Swift 6, UIKit, and Xcode 26

Arrow left icon
Product type Paperback
Published in Nov 2025
Publisher Packt
ISBN-13 9781806023936
Length 634 pages
Edition 10th Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Ahmad Sahar Ahmad Sahar
Author Profile Icon Ahmad Sahar
Ahmad Sahar
Arrow right icon
View More author details
Toc

Table of Contents (35) Chapters Close

Preface 1. Swift
2. Hello, Xcode FREE CHAPTER 3. Simple Values and Types 4. Conditionals and Optionals 5. Range Operators and Loops 6. Collection Types 7. Functions and Closures 8. Classes, Structures, and Enumerations 9. Protocols, Extensions, and Error Handling 10. Swift Concurrency 11. Design
12. Set Up the User Interface 13. Build the User Interface 14. Complete the User Interface 15. Modify App Screens 16. Code
17. MVC and Table Views 18. Get Data into Table Views 19. Pass Data Between View Controllers 20. Core Location and MapKit 21. JSON Files 22. Custom Views 23. Camera and Photo Library 24. Search 25. Collection Views 26. Features
27. Adopt Liquid Glass 28. Icon Composer 29. Apple Intelligence 30. Foundation Models 31. Test and Submit Your App to the App Store 32. Unlock Your Exclusive Benefits 33. Other Books You May Enjoy
34. Index

Load and save JSON data

Now that you have modified the JournalEntry class to conform to the Codable protocol, you are ready to implement loading data from and saving data to JSON files.

To make it easier for you to work with JSON files, Apple provides JSONDecoder and JSONEncoder classes.

A JSONDecoder instance decodes instances of a data type from JSON objects, and you will use it when loading files from your device storage.

A JSONEncoder instance encodes instances of a data type to JSON objects, and you will use it when saving files to your device storage.

You’ll now implement the methods to load data from a file and save data to a file in the SharedData class. Follow these steps:

  1. In the Project navigator, click...
lock icon The rest of the chapter is locked
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
iOS 26 Programming for Beginners
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Modal Close icon
Modal Close icon