icloud

How to automatically reflect CoreData+iCloud Changes in SwiftUI view?

荒凉一梦 提交于 2020-12-01 11:19:26
问题 🤓 So ...I have an app with StoreData and iCloud enabled. My data is syncing between the devices but I don't ge the behaviour I want when it comes to reflecting the changes in the UI. The behaviour I want: When a user has my app open on two devices (A & B) and makes a change one one (A) of them I want the change to automatically reflect in the second (B) device UI within some reasonable time. The behaviour I currently have: When the user makes changes on one device (A) nothing ever happens on

Is there an API for iCloud disk capacity and usage?

不问归期 提交于 2020-08-24 05:28:33
问题 I use NSFileManager to get the current device disk space (total, used, and free) like so... let systemAttributes = try? NSFileManager.defaultManager().attributesOfFileSystemForPath(NSHomeDirectory() as String) let space = (systemAttributes?[NSFileSystemSize] as? NSNumber)?.longLongValue Is there any way to do something similar for a user's iCloud account? I want to be able to present a user's iCloud disk space statistics within an app. 回答1: Capacity iCloud online capacity is determined by

Crash occurs when executing Share Extension twice in system Files to share file to app

与世无争的帅哥 提交于 2020-08-07 05:07:33
问题 The app uses Share Extension to import a string of .txt files to Core Data. And then syncs the Core Data to iCloud. There is an entity called Item . When sharing a new item in system Files through Share Extension, the code needs to calculate the order for the new item to be imported. And the code is: import Foundation import CoreData @objc(Item) public class Item: NSManagedObject, Identifiable { class func nextOrder() -> Int { let keyPathExpression = NSExpression.init(forKeyPath: "order") let

“Use default container” doesn't show in iCloud Capabilities

守給你的承諾、 提交于 2020-08-02 07:41:45
问题 I want set up iCloud sync for CoreData using CloudKit . But when I add iCloud in Capabilities and enable CloudKit checkbox, Use default container don't appear as described in the Doc: Instead, I got this: Maybe I'm missing something? 回答1: This changed in Xcode 11, there no longer is a default container checkbox. Instead you have to create your own container. Just press the + and enter your bundle-id. Xcode will automatically prefix it with iCloud. So the result will be iCloud.<your app’s

“Use default container” doesn't show in iCloud Capabilities

瘦欲@ 提交于 2020-08-02 07:41:42
问题 I want set up iCloud sync for CoreData using CloudKit . But when I add iCloud in Capabilities and enable CloudKit checkbox, Use default container don't appear as described in the Doc: Instead, I got this: Maybe I'm missing something? 回答1: This changed in Xcode 11, there no longer is a default container checkbox. Instead you have to create your own container. Just press the + and enter your bundle-id. Xcode will automatically prefix it with iCloud. So the result will be iCloud.<your app’s

Does iCloud need to be in the Production environment in order to use in Production?

人盡茶涼 提交于 2020-07-19 10:58:40
问题 I added Cloudkit support to my iOS and WatchOS App, but I cannot deploy my schema to production due to a bug: Do I need to wait until this is fixed so I can deploy to Production or can I ship and still be in Development mode on the console? I've also read that I can edit my plist to switch to development mode but I am not seeing that option in my Entitlements: Update: July 13 6pm EST no longer getting the error message but now it acts as if it is going to deploy but when I hit cancel and