NSKeyedArchiver and NSKeyedUnarchiver classes are not the only way to encode and decode data to a be easily written on disk. There are many other formats like JSON.
The easiest way to serialize Swift models to JSON is by conforming to Codable. To learn how this works, see our tutorial about it.
I hope you enjoyed this tutorial. If you have any questions or comments, please don’t be “scared” and join the forum discussion below. :]
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.