First of all, big thanks to this site for existing, as it's arguably the single best site for learning Swift.
The Core Data project, Project 38, is a good start, but...
I have been tasked with developing an application that receives images, saves them to disk, and then uploads them to a server. The requirements for the application are that images should exist on disk locally even after being uploaded, the network should not be considered 100% reliable, and that the upload should not be a blocking operation. Everything makes sense so far, right?
Obviously, Core Data is involved. I need to store where the images are saved as well as various bits of metadata about them, including whether they have been uploaded to the server. So part of the application saves the record of the files to Core Data, and another part will read them, upload them, and then store that they've been uploaded. Yet another part of the application should allow the user to search through past (saved) files and access them.
How should I make the different pieces of the application use Core Data? Should (can) I use a singleton class from each part/thread? Can I instantiate different contexts for each piece (or will they overwrite each other)? Should I create an instance of NSPersistentController on the ViewController and then pass it around to all the code that will use it?