2,366 questions
0
votes
0
answers
13
views
Issues with Updating Widget Timeline Based on SwiftData/CoreData Changes in WatchOS App
I tried looking everywhere online and asked AI, but it seems none of the solutions resolved my issue. I am using CoreData or SwiftData with CloudKit to fetch data from the database. I created a simple ...
-3
votes
0
answers
13
views
How do i resolve Swift error: "Type of expression is ambiguous without a type annotation" in CloudKit [closed]
You are encountering an ambiguous type error in your CloudKitManager.swift file, specifically with the message "Type of expression is ambiguous without a type annotation." This error arises ...
-1
votes
0
answers
35
views
How to track sync status with CloudKit/SwiftData in SwiftUI
I've setup CloudKit to work with my SwiftData app. Now my next hurdle is that when I reinstall the app, there is about a 1-2 second delay for all of my data to reappear. When app launches it shows as ...
-1
votes
0
answers
55
views
SwiftData not syncing with iCloud: Server Rejected Request
I'm trying to get my SwiftData app to sync with iCloud, however I keep getting the same exact CloudKit error 15 ("Server Rejected Request") and nothing syncs between my devices. I've ...
0
votes
0
answers
30
views
Why can't I use .deleteSelf for CKRecord.setParent(...)?
I'd like to:
Use hierarchical sharing with CloudKit, with a shared root record, and a tree of children that automatically get shared alongside.
Have the entire hierarchy be deleted automatically when ...
0
votes
0
answers
36
views
Silent push notifications not working on some iOS devices
I send APNs notifications to my devices with the CloudKit dashboard. I test with two devices;
Device with Silent Push Working Successfully:
iOS version 16.5.1 (c), Model iPhone Xs
Silent Push Failed ...
1
vote
0
answers
22
views
CKUserIdentity `nameComponents` is Empty
My App requires that the user has and allows iCloud access. With that access I expect to be able to access the users name. Yet, the following code produces an empty nameComponents result from ...
0
votes
1
answer
55
views
SwiftData issue adding model objects when syncing to CloudKit
I'm building a simple app that persists data using the SwiftData framework with the additional capability of syncing through CloudKit across devices.
All was well until I added a second model object. ...
0
votes
1
answer
98
views
Why isn't SwiftData updating the items in a ForEach loop when synced with iCloud but it does if just used with a List
I have an app that uses SwiftData which is set to be synced with iCloud.
When I run the app in the simulator and on an actual device simultaneously and then amend the customer name on the simulator ...
0
votes
0
answers
27
views
CloudKit works on simulator but not on a real device
I'm developing an iOS 18 app that includes an inbox that allows me to send messages to all app users. I've used Private Database entries in my CloudKit to allow me to send the message to everyone and ...
0
votes
0
answers
18
views
How to fix CloudKit iCloud uploads after user deletes app folder from their iCloud?
I'm implementing a feature to upload and download files from iCloud in my app. Everything is working as expected, however, I noticed that if I delete the app folder from iCloud drive (as an end-user) ...
1
vote
0
answers
68
views
Does CloudKit guarantee CKRecord.Reference is always valid?
I'm considering using CloudKit in my app (it doesn't use Core Data) and have read as many materials as I can find. I haven't fully grasped it yet and have a basic question on CKRecord.Reference. Does ...
0
votes
0
answers
29
views
How to overwrite when CloudKit CoreData is synced
Swift UIKit
I'm using CoreData CloudKit.
I want to overwrite values instead of merging them when syncing.
I have the following data:
CloudKit Data (smartphone A)
memo:"123"
In-app data (...
0
votes
1
answer
81
views
How to make a Range key value compliant in CloudKit?
In my app (which utilizes SwiftUI, SwiftData and CloudKit), I have the following class and enum:
@Model
class CategoryType
{
var name: String = ""
var parameterType: ...
0
votes
0
answers
23
views
SwiftData: Predicate using optional Codable enum [duplicate]
I'm currently developing an app using SwiftData.
I want the app to use CloudKit to sync data, so I made sure all my model properties are optional.
I’ve seen solutions when the enum is not optional, ...
0
votes
1
answer
95
views
How to handle data migration when using CloudKit?
General problem
I have an iOS app which uses Core Data with CloudKit and I reached the point where I need to evolve the schema and migrate existing data.
Schema changes
What I need is adding a new ...
1
vote
1
answer
133
views
Persisting data with objects that can have default predefined values and user generated values
I'm developing an app using SwiftData and CloudKit that presents the user with a selectable List of movie genres to choose from, populated from an enum and another array of objects (more on this in a ...
0
votes
0
answers
110
views
How to cache CKRecords efficiently in SwiftUI
I'm building a SwiftUI social photo-sharing app that uses CloudKit, where user profiles (including a CKAsset for profile pictures) are displayed throughout the app. To reduce redundant fetching of ...
0
votes
0
answers
24
views
CloudKit subscriptions are created successfully but notifications don't arrive
I have a macOS app currently in development and an iOS app that has already been released.
The iOS app was built using the SwiftUI life-cycle and the macOS app is being built with AppKit. (I'm not ...
0
votes
0
answers
23
views
Why does CloudKit not save/fetch the data?
When I try to upload an instance of the ‘Printer’ class to CloudKit and then download it again to display it in SwiftUI, it always shows that ‘allAddedPrinters’ is empty.
I start this action with the ...
0
votes
0
answers
47
views
CloudKit Integration Issue: Record Type Not Found
I'm working on an iOS app that uses CloudKit for data synchronization. I'm encountering an issue where my app can't find the "JournalPrompt" record type in the public database. Here's the relevant ...
0
votes
1
answer
21
views
Cloudkit records disappeared
App crashed showing error index out of range. In cloudkit dashboard, querying the table showed half of the records missing.
No changes were made neither to the app nor the database since the last ...
0
votes
0
answers
22
views
Why is the iCloud given name not being fetched?
The iCloud-Givenname is not retrieved. Instead, ‘Name not available’ is always displayed. There is no other error message. Is the Apple-ID-Name the same as the iCloud-Name? Here ist the related code:
...
0
votes
0
answers
16
views
CKQuery returning nothing when record exists
I am implementing login capabilities to an app using a cloudkit database. The record exists and I know its the right cloudDB because the sign up function works properly so if someone could provide ...
0
votes
0
answers
27
views
What replaces the deprecated ".requestApplicationPermission([.userDiscoverability])" Method? [duplicate]
I built a CloudKit-Database and I wanted to get the Username from the User. However, I cant get permission to access the Data from the User, because ".requestApplicationPermission([....
1
vote
0
answers
72
views
Why is an implicitly set relationship property crashing when I'm trying to access it? [duplicate]
I'm using SwiftData with CloudKit and I have the following two classes:
@Model
class Category
{
@Relationship(deleteRule: .cascade, inverse: \Book.category) var books : [Book]?
var project: ...
0
votes
0
answers
162
views
Improving iCloud Sync Speed for SwiftData in iOS and watchOS Apps
I'm developing an iOS app (for iPhone and iPad) with a watchOS companion app using SwiftData and iCloud. I've set up the following:
SwiftData model with optional/default parameters
iCloud capability ...
0
votes
0
answers
58
views
Do You Need 2 Bundle Ids and 2 Targets to Use Swift Data and CloudKit for Dev and Prod?
I’m using Swift Data and CloudKit, with a private container.
When developing my understanding is that you should have a target with com.apple.developer.icloud-container-environment key set to “...
-1
votes
1
answer
52
views
Child view not rendering when adding @Query macro - Infinite loop
For some reason when I add an @Query macro to my child view it fails to render. If I simplify my child view by just adding a plain text field while still leaving the @Query macro it still won't render....
1
vote
1
answer
151
views
How to solve relationship issues with SwiftData / CloudKit?
I have the following model set up in my app which utilizes SwiftData and Cloudkit. A Project object has an array of Book objects. A Book object has an array of Reader objects. A Reader object has an ...
0
votes
0
answers
56
views
How to share CKRecord with CKShare properly
When i try to save CKRecord with CKShare using setModifyRecordsCompletionBlock
NSOperationQueue * quwuw = [[NSOperationQueue alloc] init];
[quwuw setMaxConcurrentOperationCount:1];
[self ...
0
votes
0
answers
17
views
No way to reset CloudKit server badge count?
Whilst all current answers to this question indicate the depreciation of CKModifyBadgeOperation, all of them had advised up until 2022 that it could still be used due to Apple not having a replacement ...
0
votes
1
answer
93
views
How to make CloudKit compatible when you have enum driven selectable list
For a book club app I'm writing In SwiftUI, I have a NavigationSplitView that has a selectable List on its leading column. The first item on the list is "Book" and will take the user to a ...
0
votes
0
answers
58
views
SwiftData migration with iCloud and multi-device support
I’m writing test apps using SwiftData. Running migrations locally works fine. But I couldn’t find anything on how to handle a situation, where my local app is running on e.g. ‘MigrationSchemaV2’ and ...
0
votes
0
answers
310
views
Using SwiftData how does one sync a public database?
I have an iOS project with CloudKit, Background, and Remote Notifications enabled.
I have specified an @Model type that matches the name of the record in the CloudKit database.
But when I created the @...
0
votes
0
answers
39
views
About CloudKit Security Roles and Permissions
I've checked that there are some questions like mine. But the terminology seems to have changed and it's been time, so I opened a new question.
Hi, I'm trying to add the ability to back up and record ...
0
votes
1
answer
56
views
Does the Apple CloudKit dashboard only show developer data?
I am creating an iOS app.
I saved the data using Realm, but I found CloudKit while I was looking into it because I thought there were many inconveniences with the backup.
I understand that CloudKit ...
1
vote
1
answer
229
views
SwiftData custom migration crash when CloudKit enabled
I have an app that is in production that has a single entity called CDShift. This is the class:
@Model
final class CDShift {
var identifier: UUID = UUID()
var date: Date = Date()
...
}
...
0
votes
1
answer
127
views
How to save to specific Stores/Configurations in Core Data
I'm currently syncing core data with the CloudKit private and public databases, as you can see in the code below, I'm saving the private database in the default configuration in Core Data and the ...
0
votes
0
answers
19
views
NavigationList not working in NavigationStack
I have two simple modules in my Swift program. One maintains a list of Locations and the second maintains a list of Activities. The locations module works fine while the Activities module freezes! ...
3
votes
0
answers
95
views
Understanding Syncing between Core Data and CloudKit Public Database using NSPersistantCloudKitContainer
Can someone please give me an overview of how sync works between Core Data and the public CloudKit database when using the NSPersistentCloudKitContainer and please point out my misunderstandings based ...
0
votes
1
answer
63
views
How can we reliably detect when a user runs out of iCloud storage?
I am using NSPersistentCloudKitContainer, to integrate CoreData with CloudKit.
What I want to achieve is to prompt the user to go to iCloud settings to manage their storage when there is a sync error, ...
0
votes
1
answer
112
views
Local Core Data Backup/Restore iCloud conflict “ Told to tear down with reason: Stores Changed”
I have a backup / restore function for Core Data defined like this:
import CoreData
import FirebaseCrashlytics
import Foundation
extension NSPersistentCloudKitContainer {
enum ...
-1
votes
1
answer
22
views
CloudKit CKQuery Predicate to find next available name
I'm attempting to query the CloudKit database for the following -
(Example)
userName = "Fred"
Let's say that this is unavailable (checked with a query), so I want to find names which begin ...
1
vote
1
answer
90
views
Use CloudKit with CoreData store in shared AppGroup container
Because I added widgets that need access to the CoreData store, I have moved the store into a shared AppGroup container. That has worked well, with no issues. However, I have been unable to get it to ...
0
votes
1
answer
26
views
Error adding private sharing PCS to public sharing PCS for share
I am attempting to use the open ai image API and send images. Unfortunately, they don't let you send image data directly, instead, you have to save and share the image to the cloud, and send their ...
1
vote
0
answers
27
views
App memory (documents & data) increases every single call to iCloud?
i have an issue where my application's 'documents & data' increases every call to icloud for my "countries" objects. I have simplified the entire process down to the block of code below ...
0
votes
0
answers
33
views
How do coredata and cloudkit communicate
I accidentally deleted some entities from Core Data on my macOS app. I had a backup of the sqlite file so I restored it. Now after some days the data disappeared again. My question is: if I restored ...
0
votes
1
answer
84
views
NSPersistentCloudKitContainer migration with custom NSEntityMigrationPolicy
Recently, I have made quite extensive changes to my schema and need to migrate my CoreData + CloudKit model to a new version. The changes require me to use a custom NSEntityMigrationPolicy because I ...
0
votes
1
answer
137
views
CloudKit sync issues when not running via Xcode
I have written a macOS app using SwiftData and CloudKit with the intent of sharing data records between devices. If I build and run the app via Xcode, I can create a new record and observe it ...