I have an older Core Data / iCloud app that I wish to convert toi Core Data / CloudKit. I also want to do a major update to iOS 13.0My questions are about the persistent store that is in 'ubiquity'.In my app, the original path to the persistent store isOriginal iCloud store path: /var/mobile/Containers/Data/Application/Blah1/Documents/iCloudStore.sqliteHowever, I have to add the options for the persistent store coordinatoor as follows:iCloudOptions = [NSDictionary dictionaryWithObjectsAndKeys: @"iCloudStore", NSPersistentStoreUbiquitousContentNameKey, nil];The path to the actual persistent store in upbiquity is nowUbiquity iCloud store path: /var/mobile/Containers/Data/Application/Blah1/Documents/CoreDataUbiquitySupport/mobile~Blah2/iCloudStore/Blah3/store/iCloudStore.sqliteNSPersistentStoreUbiquitousContentNameKey is deprecated.The question is, can I just grab the persistent store that is in the Original location, or do I have to grab the persistent store that is in the Ubiquity location?Also, if I need to get the Ubiquity store, can. I use NSPersistentStoreUbiquitousContentNameKey with a deployment target of 13.0?Also, how do I delete the old iCloud data (or can I) for the user when the app starts using CloudKit?
Post
Replies
Boosts
Views
Activity
I have beel fiddling with SwiftUI and it has taken up a huge amount of CPU %. Has anybody else experienced this? It it takes forever to build. I think I have it confused.My Xcode is shut down, but I still have two swift processes running at 98%.Something wrong here....
I have a major issue with @ObservedObject.I have the following statement@ObservedObject var model: UserDatain a good number of views and before Beta 5, I did not have to pass this variable into the preview, nor did I have to pass his variable into other views which already have the above statement.But now I do have to and it's a mess. Is there anyway around this?
One can completely change the view controller in .compact to a UITabBarController or whatever.
Also, one can have triple columns!
I'm excited as this format can finally handle my iPhone/iPad app cases.
Here is my code currently. The problem is that the beige background color is there even when I select the cell. I know I should set a different background configuration for every state that I need to, but I don't know how for this default cell. I have created custom UICollectionViewListCells and set a different background on those depending on state. But can't figure out how to do that with the default cells.
let cellRegistration = UICollectionView.CellRegistration<UICollectionViewListCell, CellItem> { (cell, indexPath, cellItem) in
var content = cell.defaultContentConfiguration()
content.text = cellItem.title
content.secondaryText = cellItem.subText
if let imageName = cellItem.imageName {
content.image = UIImage(named: imageName)
}
cell.contentConfiguration = content
cell.accessories = [.disclosureIndicator()]
var backgroundConfig = UIBackgroundConfiguration.listGroupedCell()
/* Set a beige background color to use the cell's tint color. */
backgroundConfig.backgroundColor = UIColor(named: "CellColor")
backgroundConfig.strokeColor = .green
cell.backgroundConfiguration = backgroundConfig
}
I am using the new multi-column UISplitViewController. I have a tab bar controller set as the view controller when in compact mode. I have a view in compact mode which displays a UIDatePicker in the new .inline style. Two tableview cells segue to that date picker view. I go into the date picker view and get a date. The problem seems to happen when I change the month of the date picker. When I return from the date picker view and then go back in for another date, I get the following in my console.
[CompositionalLayout] Invalid absolute dimension, must be > 0.0. NOTE: This will be a hard-assert soon, please update your call site.
I have no idea what this is. My layout is good.
I've been testing this on the simulator. Perhaps that's why it doesn't work solidly. I have a custom UICollectionViewListCell. Some times, quite often, the cell remains after I swipe to delete. However, the cell is inoperative. Sometimes, the cell selects and slides over, but there appears to be two cells in one spot and the cell does not delete and is still operational. Here's my current code with some of it commented out because I am easter-egging a solution.
config.trailingSwipeActionsConfigurationProvider = { [weak self] indexPath in
guard let self = self else { return nil }
if indexPath.row > 0 {
let cell = self.dataSource.collectionView(self.collectionView, cellForItemAt: indexPath) as! SavedVacationCell
let vacation = cell.vacation!
print("Going to delete it.")
let actionHandler: UIContextualAction.Handler = { action, view, completion in
action.image = UIImage(systemName: "trash")
// var snap = self.dataSource.snapshot()
// snap.deleteItems([vacation])
// self.dataSource.apply(snap, animatingDifferences: true)
if vacation.uuid!.count == 36 {
self.vacations?.removeAll(where: {$0.uuid == vacation.uuid})
var snap = self.dataSource.snapshot()
snap.deleteAllItems()
self.setSnapshot()
// self.loadSavedData()
// self.saveDataToAppleWatch()
}
self.deleteVacationAndReload(vacation)
completion(true)
}
let action = UIContextualAction(style: .destructive, title: "Delete", handler: actionHandler)
action.image = UIImage(systemName: "trash.fill")
action.backgroundColor = .systemRed
return UISwipeActionsConfiguration(actions: [action])
}
return nil
}
I'm sure I am doing something wrong. if anybody has a better solution or the correct solution, I'd like to know about it.
Thanks.
For iOS 14 and watchOS 7.0, I completely recoded and modernized my app using Swift (was Objective C). I am almost done and am most proud of the job, but I have this issue that I need to fix on the Apple Watch app. I am not able to transfer data to the Apple Watch from the iPhone and get the following console messages. (The [***:xxxxxx] are my modification of the console messages.). I am guessing that the first 2 messages are the thing I need to fix and I need to fix this issue before I submit the app.
2020-09-24 08:29:02.873423-0400 WatchApp Extension[***:xxxxxx] [default] lookupMainFuncAddressInMachHeader:71: Invalid Swift entry point data
2020-09-24 08:29:02.874413-0400 WatchApp Extension[***:xxxxxx] [default] lookupMainFuncAddressInMachHeader:77: Swift entry point addres could not be determined.
2020-09-24 08:29:04.001368-0400 WatchApp Extension[***:xxxxxx] [WC] denying activation due to missing delegate
ExtensionDelegate: your iphone is Reachable
ExtensionDelegate: Session activated
2020-09-24 08:29:10.884500-0400 WatchApp Extension[***:xxxxxx] [WC] already in progress or activated
2020-09-24 08:29:15.046379-0400 WatchApp Extension[***:xxxxxx] [WC] WCSession is missing its delegate
2020-09-24 08:29:15.047176-0400 WatchApp Extension[***:xxxxxx] [WC] WCSession is missing its delegate
2020-09-24 08:29:15.047860-0400 WatchApp Extension[***:xxxxxx] [WC] WCSession is missing its delegate
2020-09-24 08:29:15.782075-0400 WatchApp Extension[***:xxxxxx] [WC] already in progress or activated
2020-09-24 08:29:24.390293-0400 WatchApp Extension[***:xxxxxx] [WC] already in progress or activated
2020-09-24 08:31:57.059417-0400 WatchApp Extension[***:xxxxxx] [WC] already in progress or activated
2020-09-24 08:32:00.055282-0400 WatchApp Extension[***:xxxxxx] [WC] already in progress or activated
InterfaceController: your iphone is Reachable
2020-09-24 08:32:00.058230-0400 WatchApp Extension[***:xxxxxx] [WC] already in progress or activated
2020-09-24 08:32:08.427192-0400 WatchApp Extension[***:xxxxxx] [WC] already in progress or activated
2020-09-24 08:32:13.374677-0400 WatchApp Extension[***:xxxxxx] [WC] WCSession is missing its delegate
2020-09-24 08:32:13.375717-0400 WatchApp Extension[***:xxxxxx]] [WC] WCSession is missing its delegate
2020-09-24 08:32:13.376426-0400 WatchApp Extension[***:xxxxxx] [WC] WCSession is missing its delegate
2020-09-24 08:32:51.861915-0400 WatchApp Extension[***:xxxxxx] [WC] already in progress or activated
I've created a macOS app using Catalyst from my iPad app. I see this message in the console and I need to know what it means. Thanks.
I am using Core Data with CloudKit and I realized that a Core Data Entity was not saved and therefore that did not show up in the CloudKit Schema. I am running my app in the Development environment and saving the entity, but it's not showing up in the Schema. How do I get CloudKit to see this in the Schema and do I need to use the Development environment? If so, if I deploy to production, will that mess up my other entities in the schema?
I have a CloudKit / Core Data app with saved entities. In my app, the user can modify an attribute of one of the entities and resave the entity in Core Data. I can see the modified attribute on the device I used to modify the information, but the entity does not sync to my other devices. Is there a way to get the entity to sync using CloudKit?
When I try to log into CloudKit Dashboard via Safari, I get a blank screen as a result. The only way I am able to get in is thru Xcode and my app that uses CloudKit Dashboard. Anybody else experiencing this?
Thanks
I get the following.
403 Forbidden
Anybody else have this problem?
Anybody converting from CKQueryOperation to the new CloudKit async await methods? If so, what do you think? I'm currently playing with
func records(matching query: CKQuery, inZoneWith zoneID: CKRecordZone.ID? = nil, desiredKeys: [CKRecord.FieldKey]? = nil, resultsLimit: Int = CKQueryOperation.maximumResults) async throws -> (matchResults: [(CKRecord.ID, Result<CKRecord, Error>)], queryCursor: CKQueryOperation.Cursor?)
and
func records(continuingMatchFrom queryCursor: CKQueryOperation.Cursor, desiredKeys: [CKRecord.FieldKey]? = nil, resultsLimit: Int = CKQueryOperation.maximumResults) async throws -> (matchResults: [(CKRecord.ID, Result<CKRecord, Error>)], queryCursor: CKQueryOperation.Cursor?)
They seem to work fine and eliminate completion handlers.