Exposing an app’s ubiquitous container to iCloud Drive in iOS 8

I was experiencing a similar problem with my application. I was able to make this work by doing the following: Add the NSUbiquitousContainers setting to my Info.plist file according to documentation here https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/ExtensibilityPG/FileProvider.html. Here is the relevant code: <dict> <!– … other top-level Info.plist settings … –> <key>NSUbiquitousContainers</key> <dict> <key>iCloud.com.example.MyApp</key> <dict> <key>NSUbiquitousContainerIsDocumentScopePublic</key> <true/> <key>NSUbiquitousContainerSupportedFolderLevels</key> <string>Any</string> … Read more

How to use iCloud to store and sync app files

What “works” for me is just simple: NSFileManager *fm = [NSFileManager defaultManager]; NSURL *ubiq = [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil]; if (ubiq == nil) { return NO; } NSError *theError = nil; [fm setUbiquitous:true itemAtURL:backupUrl destinationURL:[[ubiq URLByAppendingPathComponent:@”Documents” isDirectory:true] URLByAppendingPathComponent:backupName] error:&theError]; Apple says to call on the non-UI thread. Having the files “moved”. You can query for them … Read more

Xcode 6 iOS 8 iCloud core data setup

iOS 8 Solution: OK…then….lol. I think I solved it. New discovery. After skimming through this page: http://www.tuaw.com/2014/09/17/psa-do-not-upgrade-to-icloud-drive-during-ios-8-installation/ It says: iCloud Drive is Apple’s new and improved iCloud syncing and file storage feature that allows you to share documents between your iOS 8 devices and your Mac running OS X 10 Yosemite. So, I decided to … Read more

Check if User is Logged into iCloud? Swift/iOS

If you just want to know if the user is logged in to iCloud, the synchronous method can be used: if FileManager.default.ubiquityIdentityToken != nil { print(“iCloud Available”) } else { print(“iCloud Unavailable”) } If the ubiquityIdentityToken is nil and you’d like to know why iCloud isn’t available, you can use the asynchronous method: CKContainer.default().accountStatus { … Read more

How do I delete a CloudKit container?

Apple’s iOS CloudKit documentation: Enable iCloud and Select CloudKit Important: When you select CloudKit, Xcode creates a default container ID based on the bundle ID. Because you can’t delete iCloud containers, verify that your bundle ID is correct in the General pane in Xcode before selecting CloudKit. To change your bundle ID, read Set the … Read more

tech