Is there an easy way to store my app's data in Swift 3?
I would like to store a single object in some way. I tried UserDefaults.standard.set(my_object, forKey: "my_object")
but it doesn't seem to work.
I put this code in AppDelegate.swift in func applicationWillTerminate(_ application: UIApplication)
Also, I would like to read this object back in func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool
, when the application starts.