How to use persist & retrieve an NSCoding compliant object to app Document directory in Swift 3?
Here's a NSCoding compliant object. I would like to save and recover it from the app's documents directory in Swift 3. I imagine it's a save method and recover method. How is this done? import Foundation class Book: NSObject, NSCoding { var title: String var author: String var pageCount: Int var categories: [String] var available: Bool init(title:String, author: String, pageCount:Int, categories:[String],available:Bool) { self.title = title self.author = author self.pageCount = pageCount self.categories = categories self.available = available } // MARK: NSCoding required convenience init?