nsfilemanager - What's the Swift 3 enumerateContentsOfDirectoryAtPath Syntax? (Haneke)

I'm converting the Haneke Cacheing framework to Swift 3 and I've run into a snag with enumerateContentsOfDirectoryAtPath.Here's the original syntax (view on github),let fileManager = NSFileManager.defaultManager()let cachePath = self.pathfileManager.enumerateContentsOfDirectoryAtPath(cachePath, orderedByProperty: NSURLContentModificationDateKey, ascending: true) { (URL : NSURL, _, inout stop : Bool) -> Void in if let path = URL.path { self.removeFileAtPath(path) stop = self.size <= self.capacity }}I be...Read more

ios - Using Pre-Existing NSFileManager Code with iCloud

I just wrote a few hundred lines of code for saving files, opening files, and deleting files in my iOS app... then I realized that I probably should've explored iCloud and integrated it as I was writing my code.Is there any way to integrate iCloud into a pre-existing Documents structure, nsfilemanager class, etc.? Or will I have to re-write most of my code from the ground up?Also, either way, are there any iCloud Projects out there (similar to this one) that would allow me to easily integrate iCloud Document Sync?Just a quick sample of some cod...Read more

nsfilemanager - open document programmatically from UserDefaults in UIDocumentBrowserViewController

I am working on a document based app in swift using UIDocumentBrowserViewController. I would like the app to default to opening the previous file that was used in the last session. When exiting the app I save the file URL in UserDefaults. When I restart the app, UIDocumentBrowserViewController presents its view. I would like to add in viewDidLoad() an if-statement that checks if a fileURL exits in UserDefaults. If it does I would like to select that file, open it and present it. The simplest approach would seem to be to figure out how to p...Read more