I am developing an app that lets the user record videos and photos. Now I am wondering what is the best way to store them?
The first idea is of course to save it in
Use Code Data to store images and big files.
Code Data can save binary data to disk for you automatically, just set this option on the properties of the attribute, you just need to activate the option to allow external storage and Core Data will do the magic for you, simple as that.
Here you are the function to do in Swift3
//Image
let imageData = UIImageJPEGRepresentation(image, 1) // You can low compression up to >0
//Video from URL
let videoData = NSData(contentsOf:videoURL!)
Its so simple! iOs sweet programming.