Group Group Group Group Group Group Group Group Group Forums

iCloud and UIDocument: Beyond the Basics, Part 4/4

This is a blog post by site administrator Ray Wenderlich, an independent software developer and gamer. Welcome back to the final part of our document-based iCloud app tutorial series! In this tutorial series, we are making a complete document-based iCloud app called PhotoKeeper, with features that go beyond just the basics. In the first and […]

This is a companion discussion topic for the original entry at

Hi all. New to forums. Longtime fan of your tutorials. Super useful. Some questions in regards to this tutorial.

  1. Do you have a revised tutorial planned that uses Swift 3?

  2. I’ve rewritten the file manager portions of the tutorial in Swift 3 and it’s working but I’ve noticed some odd/annoying things about iCloud. NSMetaquery appears to send back a file list that contains deleted files sometimes (this is testing only in iOS simulator and not with any other devices). Is there a reason you’ve taken the approach of grabbing the URLs from the query instead of from the updates notification itself (which groups them by change type)? And do you have a workaround for this issue (of deleted files being essentially reanimated back to life)?

  3. In a few places I’ve seen some odd behaviors happening with timing on UI updates (i.e. new doc showing up twice in the tableview initially and calling the UI update before adding the document itself seems to fix this and make sense since it’s called just after the new document file is being created but I think it winds up being at the same time as the notification arrives. It doesn’t seem to be an issue with your sample code but for some reason it is in my Swift 3 version. I believe my code is identical in approach and I’ve checked in many (many) times. Is it possible that Swift handles threads differently somehow?

This tutorial is more than six months old so questions are no longer supported at the moment for it. We will update it as soon as possible. Thank you! :]