Swiftdata cloudkit. I have a few non-optional things in my model and provided default values for them (a few numbers which logically would default to 0 anyway). If you used Note app in any apple device, you will For the most part, backing up your SwiftData models with CloudKit is extremely straightforward, arguably mostly automatic. hackingwithswift. swift: 159: Fatal error: failed to find a currently active container for Task. 有 An app that uses SwiftData requires at least one model container. 1 and SwiftUI 5. 你可以在 Xcode 的 Target 设置中的 "Signing Jul 4, 2023 · SwiftData Syncing Using CloudKit. "Ideally", I'd like to do that after the CloudKit sync completed. 0+ Swift 5. The above is a minimum reproducible example (and not my actual application). JSON: You can save data directly to the file system using APIs provided by Foundation framework. Each topic has a Share button on the right. One can observe . Appleが提供している CoreData や外部ライブラリである Realm などと属性としては同じであり、 SwiftData は CoreData の後継という立ち位置かと思います。. 0+ iPadOS 17. Jun 8, 2023 · SwiftData has similar superpowers to NSPersistentCloudKitContainer, infact i'm pretty sure its just wrapping that, so lets get to know them. If I have a CloudKit container entitlement in my app, can I disable the SwiftData container from using it for previews and unit testing? For example, in Core Data I can delete the CloudKit options in the persistent store description before loading. So the problem is, that it is simply no syncing to iCloud: error: CoreData+CloudKit: - [NSCloudKitMirroringDelegate _performSetupRequest:]_block_invoke (): <NSCloudKitMirroringDelegate: 0x282648620>: Failed to set up CloudKit integration for store: <NSSQLCore May 2, 2021 · 1) The code supplied by Nick and the team doesn't seem to work for me in Xcode 13 (Beta 1 or Beta 2) 2) The code supplied doesn't seem to make use of the SwiftUI framework, which is where I thought Apple was pushing developers 3) The boilerplate code for a CloudKit hosted CoreData application doesn't seem to work either To do that, click the blue Project33 icon in the Project Navigator pane, then choose your Project33 target. In 2020 and 2021, Apple continued to enhance Core Data with CloudKit, adding functionality for syncing public databases and shared databases on top of the initial support for private database syncing. static var models: [any PersistentModel. It uses the UserDefaults class to store data in key-value pairs. To save a record to your container, you must pick a database to save the record to. A key player in SwiftData’s functionality is the @Model Sep 30, 2023 · As soon as you enable CloudKit support for your app, SwiftData will automatically start syncing your local data with iCloud. "SWDMyApp" , schema: fullSchema, sharedAppContainerIdentifier: "my. I added a container on the web dashboard. Get your head in the clouds. Overview. swift. In theory, you needed only three steps. For example, in the todo app, you can create a zone with the name of the todo list and share it with your family. Start passing specific records from NSPersistantCloudKitContainer into the sharing feature implemented in step 2. Using the view modifier ensures all windows in the modified window group, or all child views of the modified view, access the same model container. Swift. According to the Apple's docs: @Attribute - The framework synchronizes changes concurrently and at opportune times, which means CloudKit is unable to enforce the unique property option. You can create a schema using CloudKit Dashboard, or you can create a just-in-time schema by writing records programmatically. Find out how ModelContext and ModelContainer work together to persist your app's data. この記事では SwiftUI 関係の機能には触れずに、純粋に SwiftData の挙動のみを Mar 17, 2023 · Core Data with CloudKit: Synchronizing Public Database. Aug 5, 2021 · 这意味着无需编写大量代码,使用 Core Data with CloudKit 可以让用户在他所有的苹果设备上无缝访问应用程序中的数据。. cloudkit. Review the changes that are going to be deployed. ie, PersistenceController and managed object context. An Overview of CloudKit. 0+ watchOS 10. And, as of iOS 10, a shared CKDatabase where user-controlled groups can SwiftData & CloudKit: See How To Add Syncing In Your Apps*****Timestamps:*00:00 - Intro00:26 - What is CloudKit?00:58 - Checkli Apr 9, 2020 · Sync SwiftData with iCloud using CloudKit. SwiftData employs the expressivity offered by Swift’s new language macros to ensure a seamless API interface. さらに、この CloudKit と Core Data を容易に連携させるための機能が iOS 13 から提供されるようになりました 2 。. To sync data across multiple devices in a single iCloud account, Core Data automatically mirrors your schema to a CloudKit container. timestamp so that it has a default value. WWDC23で発表されたCloudKitの新API. Sorting query results. Okay, so I created a new Xcode project using SwiftData, and ticked the box for iCloud integration. On a separate offline device, they Jun 28, 2023 · It consists of four main components: Model Classes: The model classes define the schema for your SwiftData application. CloudKit automatically configures every CloudKit-enabled app out of the box to have a public CKDatabase (all users of the app can see everything) and a private CKDatabase (each user sees only their own data). If this isn't what you want – if you'd rather handle syncing by hand using CKSyncEngine or similar – then in theory you should be able to create a custom model configuration to disable automatic syncing. Records are the fundamental objects that manage data in CloudKit. Even if there are one-many relationship models with the cascade delete rule, SwiftData does not cascade delete items. 我们将从几个层面逐步展开:. Core Data stores the relationship in CloudKit according to its cardinality (one-to-one, one-to-many, or many-to-many), as described in this article. Consider user-created tags. Defining a data model with SwiftData. SwiftData + CloudKit process for deduplication / consuming relevant store changes? It is often the case that offline devices can add duplicate entities that needs to be merged when CloudKit syncs. let configuration = ModelConfiguration (. Embracing @Model Macro. I also have an id associated with each object which I am storing as a UUID type in core data. A container is a space in the cloud that stores all of your saved data. NSPersistentCloudKitContainer is a subclass of NSPersistentContainer capable of managing both CloudKit-backed and noncloud stores. This cloudkit swift tutorial is also a SwiftUI tutorial for beginners and has an icloud Jan 29, 2022 · Use Xcode to build and run the sample app on the devices. CloudKit syncing. Feb 4, 2024 · Some background: There currently seems to be no way to avoid duplicates in SwiftData with CloudKit enabled and apparently the only way is to manually remove duplicates. Feb 17, 2024 · CloudKit is a powerful framework provided by Apple that allows developers to store and retrieve data in the cloud. 以下是 “Host in CloudKit” 的一些关键要点:. Dec 29, 2021 · Viewed 383 times. 875 #ifdef replacement in the Swift language . Dec 7, 2020 · I have a CoreData setup with a Local store and a Cloud store, only the latter of which syncs with CloudKit. 云端数据库 : CloudKit 提供云端数据库服务,支持应用数据的存储和同步 Private data (specific for a user): The user can create a custom recipe which is stored locally and synced remotely. Jan 22, 2021 · I'm using CloudKit to store my data but now I have to close the app every time something changed. We'll show you how to track and make your changes manually and use SwiftData at scale with FetchDescriptor, SortDescriptor, and enumerate. SwiftData tutorial: Building a complete project. Before you start, there's an important warning: syncing data to iCloud requires an active Apple developer account. Compatible with Core Data. It provides a seamless way to synchronize data across devices and offers a scalable solution for storing large amounts of data. Enabling CloudKit Support. ModelContainer: The model container is the broker between the model context and the persistent store (or stores). import & . Oct 28, 2020 · NSPersistentCloudKitContainer provides a bridge between your Core Data store and CloudKit, Apple’s framework for iCloud data storage. 本篇文章中,我们将探讨 Core Data with CloudKit 应用中最常见的场景——将本地数据库同步到 iCloud 私有数据库。. Switch from old Core Data in iCloud to the modern You can use the CloudKit Database app to inspect data within the public database of an iCloud container. Following the Apple guide, it was trivial enough to set up an Entity, add the appropriate capabilities in Xcode, set up the . CloudKit 允许用户在登录其 iCloud 账户的每台设备上访问他们的数据 Remember: CloudKit tells us when the save completes by executing our code as a closure, and that could be running on any thread. Querying SwiftData objects in SwiftUI. Apr 26, 2022 · Share. iOS 17. Begin by launching Xcode and opening the CoreDataDemo project. For example, you could create a configuration that loads specific model types, writes to a custom database file, and connects to a particular CloudKit database name, like this: Nov 20, 2023 · SwiftData and CloudKit console intro using Xcode 15. SwiftData+Cloudkit Migration Failed. If you develop using the same iCloud account to store private data, you can also use the CloudKit Database app to inspect and edit private data. Dec 29, 2023 · SwiftDataはiOS17から使用できる、データを永続化するためのフレームワークです。. In this tutorial, you’ll integrate CloudKit and Core Data in an app called PlaceTag, which lets you save a title, description and image for places you visit. tech. This video is about CloudKit for beginners. Participant, which contains the info you'd like to access, you'd need to implement a coexistence approach with Core Data and SwiftData. Mar 29, 2022 · A zone is a defined bucket inside the private database of the current user. I understand general database schemas, I just don't understand how any of this works between CloudKit Containers and Swift Data. The debugger is highlighting this line in the call stack (not sure if Jul 24, 2023 · SwiftData 提供了对 iCloud 的支持,可以让你的数据在用户的多个设备之间进行同步。. Creating, editing, and deleting model objects. But the primary UIViewController's view does not reflect the new data. I followed the documentation for adding CloudKit to my existing project as described at Setting Up Core Data with CloudKit. icloud. On device A, tap the Add (+) button to show the photo picker, then pick a photo and add it to the Core Data store. But it does one more thing, which is to provide usage data for your app, which is important because CloudKit is free only if you stay below certain usage limits. Core Data 为开发具有结构化数据的应用程序提供了强大的对象图管理功能。. Oct 24, 2023 · This article is aimed at showing you how to create a app using CloudKit and SwiftData with two database components, a main Vehicle list that holds a reference to a Manufacturer list entry, so Kit. Database. 0+ tvOS 17. For the most part, you don’t have to write any additional code to make the syncing work. sortDescriptors: [NSSortDescriptor(keyPath: \Exercise. Jun 19, 2023 · CloudKit sync. In this article, we will focus on building data-to-many relationships in CloudKit using Swift Feb 21, 2021 · In CloudKit Dashboard, click "Deploy to Production” button. You can define any number of record types for your app, with each record type corresponding to a different type of information. 在新项目中直接支持 Core Data with CloudKit. Paul Hudson @twostraws November 27th 2023. Next, add the CloudKit service to add the appropriate entitlements to your project and tell iCloud to create a container for your app data: Select the CloudKit checkbox. To see how much of your quota you're using, click your Jun 30, 2021 · When I switch to using Cloudkit I am unable to see changes on another device without closing/reopening the app. Repeat steps 1 and 2 for your widget. 3. It defines your data model’s entities (or tables), including their attributes, relationships, and constraints. – Joakim Danielson Jan 13 at 9:09 Overview. I have v3 models in coredata (model: Event, Lecture), and make new model in v4 with swiftdata but model name, property is different (model: EventModel, LectureModel). 在现有项目 Core Date 中添加 Host in CloudKit 支持. You will learn about Swift CloudKit save record with swift ckrecord. Don’t use the CloudKit Database app as a general data editor. 0+ macOS 14. The CloudKit Framework provides applications with access to the iCloud servers hosted by Apple and provides an easy-to-use way to store, manage and retrieve data and other asset types (such as large binary files, videos, and images) in a structured way. iCloud. Learn how you can harness the power of SwiftData in your app. For migration, I add V3Schema, V4Schema and MigrationPlan. The SwiftData sample sets up the schema with Swift types that conform to the PersistentModel protocol, which captures information about the app’s types, including properties and relationships. SwiftData provides seamless integration with CloudKit, which enables you to sync your data with iCloud. Each model file corresponds to an individual entity, with identical entity names, properties, and relationships as its Core Data Use Core Data to save your application’s permanent data for offline use, to cache temporary data, and to add undo functionality to your app on a single device. I am using the Cloudkit template in Xcode with the SwiftUI lifecycle. Nov 28, 2022 · 1. 导入模块import SwiftData。 使用@Model修饰模型。 将模型注册到ModelContainer。 获取模型上下文ModelContext。 So, the CloudKit Dashboard is basically a miniature CMS that lets you peek into your data and confirm everything is working OK. UserDefaultやKeyChainなども使い SwiftData/ModelContainer. Make sure whatever Swift files contain your SwiftData models have been added to both your app and widget targets. container = NSPersistentCloudKitContainer(name: "AppName") . Long press the photo to show the action menu, then tap the “Create New Share” button to present the CloudKit sharing UI. This happens when a user create a school and students and delete Aug 5, 2021 · In fact, as soon as CloudKit was released, developers strongly hoped for a convenient conversion between the two. This article is aimed at showing you how to create a app using CloudKit and SwiftData with two database components, a main Nov 11, 2023 · 本稿は SwiftData のモデル定義とモデルの挿入、削除、更新、取得などの基本的な操作を解説した入門記事です。. 0+ visionOS 1. You can create and assign a zone to any record in the database. What I'm considering is using Core Data (offline) and CloudKit (remote). This led down a rabbit trail of tutorials which all showed the same steps that I had already completed (add iCloud and Background Nov 6, 2021 · CloudKit is designed for manageability, flexibility, and power. You can access the model context in any SwiftUI view using the model Context environment value, and specify a particular model container or context for a view with the model Container May 10, 2023 · 4 Answers. SwiftData + CloudKit -- data not loaded on fresh install. We want to either reload the table view or show a message depending on whether there was an error, but regardless this work needs to be pushed to the main thread as it involves user interface changes. If anyone can point me to info that explains it, or give me some insight, I would appreciate it. This approach, however, is the most intricate and requires you to manually fetch and send records, resolve any conflicts, schedule operations, handle iCloud account changes, process change notifications, persist Tap the new zone to navigate to the topic view, then tap the Edit button and add a topic. I'm trying to listen for remote change notifications so that I can trigger some processes on device when a remote change from CloudKit comes in. This article will explain how to synchronize the public database to the local device using Core Data with CloudKit, and create a mirror of the Core Data database locally. CloudKit’s base types provide full control over the data you store, and the design and management of your container’s schema. Learn SwiftData hands-on with a real app project. Within a record type, you then define one or more fields, each with a name and a value. But as someone who recently published a small weekend side project to Nov 27, 2023 · Syncing SwiftData with CloudKit. 0+ Mac Catalyst 17. Jun 14, 2023 · Post would be owned by a single User, and Attendee would describe accommodations or details about the User's attendance. ”. 2. Through Core Data’s Data Model editor, you Dec 20, 2023 · CloudKit Databaseを選択。 このような画面が表示されます。 CloudKit Databaseについては後述しますので、いったんXcodeに戻ります。 Entityの定義を修正する. I have an app that uses Core Data with CloudKit to store data. appgroup. SwiftData can sync all your user's data with iCloud, and best of all it often takes absolutely no code. iOS. 0. Add the modelContainer () modifier to your Core Data doesn’t use CloudKit’s native support for relationships, CKRecord. The App itself runs, and all Cloudkit requirements are met on data model side. We will use the swift icloud api to create a swift ui basics app. Reference, because this field limits the number of references to 750, and cannot represent many-to-many relationships. If you know how to persist data using SwiftData or Core Data, you can easily sync Mar 24, 2021 · Implement CloudKit sharing on the same container. my. Records can contain simple data types, such as strings You can choose the level of detail that Core Data with CloudKit logs to the system log. In other words, I'd like to continue having the Core Data/CloudKit sync working, but with the records that get synched limited to the user's share (s). Then I added “ = Date ()” to the definition of Item. id" ) return try! ModelContainer ( for: fullSchema, configuration) And at the start of the app there is the following configuration as described in SwiftData documentation: Dec 13, 2023 · Unfortunately, having unique properties in CloudKit is not possible. And/or avoid fetching new data before CloudKit finished syncing in the first place when starting the App. Tap the Share button to show the CloudKit sharing UI, then follow the UI to send a link to the iCloud account for device B. This provides a platform for users to store private data and access Mar 9, 2016 · Sync SwiftData with iCloud using CloudKit. In order to fetch a list of the past events from NSPersistentCloudKitContainer a reference to the container is required. If you know how to persist data using SwiftData or Core Data, you can easily sync those data in multiple devices using iCloud. Disable it in the model configuration. Failed to find any currently loaded container for Task) and in the warning in the editor says Thread 1: Fatal error: failed to find a currently active container for Task. Specify a location for your project and click Create. And together with efficient syncing and sharing May 19, 2021 · I would like to make the CloudKit database a shared database and then selectively share records with users. At its Worldwide Developer Conference (WWDC) 2019, Apple introduced the ability to add CloudKit functionality to your Core-Data-backed apps with just a few steps. If you used Dive deeper into SwiftData. デバイスのローカルにあるデータとCloudKit (iCloud)の双方向な同期処理を簡単に実現できる機能. createdAt, ascending: true)], animation: . 创建可同步 Model 的注意事项. Filtering the results from a SwiftData query. Sep 30, 2023 · The ModelConfiguration initializers expose most of the options you can use with ModelContext, including schema, CloudKit containers, and more. Sep 30, 2023 · Go to your main app target's Signing & Capabilities, and add the App Groups capability. SwiftData performs the fetch when the view appears, and tells SwiftUI about any subsequent changes to the fetched models so the view can update accordingly. Choose File > New > Project to create a new project. By default, NSPersistentCloudKitContainer contains a single store description, which Core Data assigns to the first CloudKit container identifier in an app’s entitlements. Adopt SwiftData. CloudKitDebug user default setting with a debug level value as an argument to the application. After running the project on two different simulators I noticed that it was not syncing. User Defaults: User Defaults is a simple and lightweight option for storing small amounts of data, such as user preferences or settings. Nov 17, 2023 · Setting up SwiftData with iCloud share - difference to Core Data 119 Using Core Data, iCloud and CloudKit for syncing and backup and how it works together Jan 12, 2024 · When using CloudKit all relationship properties must be optional so try changing to var notebook: Notebook? in the Note model. default) private var exercises: FetchedResults<Exercise>. Second, enable the iCloud capability in your app. こちらを利用すれば、ほぼ通常通り Core Data を Nov 17, 2023 · CloudKit 关键功能. Mar 7, 2024 · Am I misunderstanding how these relationships should work in SwiftData/CloudKit? It doesn’t make any sense to me that when two models are paired together that only one of them has a reference to the relationship, and the other has no knowledge of the link. For example, there is one school has multiple students like the following models, and even when the school is deleted, the students in the school are not deleted. ” That one line, of course, is simply changing NSPersistentContainer to NSPersistentCloudKitContainer and enabling a few capabilities in the project CloudKit is designed for manageability, flexibility, and power. 同期が必要な例としてはWeb→iPad→iPhone間で同じデータを Jun 3, 2023 · I am writing an app which is backed by CoreData with CloudKit integration. When I am in the app (using the app) and create some new data on an other device, the data is fetched in a few seconds and I see it immediately, however if I am not using the app and create some new data on an other device, I have to enter the app and then the In order to use CloudKit's sharing APIs, such as CKShare. Once the project has loaded into Xcode, the first step is to add the iCloud capability to the app. The sync itself works well. Does anyone have examples or a link to a discussion of this? Nov 1, 2019 · In this iCloud Swift tutorial you will learn how to use CloudKit in SwiftUI. May 14, 2020 · I've updated an existing CoreData app to use CloudKit so that it can keep data synchronised across multiple devices (for the same iCloud account). Is this even possible. 9+. CloudKit 是 Apple 提供的一个云服务框架,它允许开发者在 iCloud 上存储用户的数据,并在用户的所有设备之间同步这些数据。. SwiftData is a fast, powerful, and easy-to-use way to store data in apps built for iOS, macOS, tvOS, watchOS, and even visionOS. Choose Product > Scheme > Edit Scheme. It is naturally integrated with SwiftUI and functions compatibly with other platform features, including CloudKit and Widgets. With @FetchRequest this should be automatic, shouldn't it? @FetchRequest(. Sep 4, 2020 · CoreData + Cloudkit fetch () after app uninstall/reinstall returns no results. The following entities are constrained: I'm trying to create cloudkit to my application integrated with existing CoreData. 2024/01/06に公開. There are some known issues in seed 1 of Mar 16, 2023 · Core Data with CloudKit combines the advantages of local persistence, cloud backup, and network distribution. The original article was written in Chinese and published on my blog 肘子的Swift记事本. In addition to adding the CloudKit capability to your app, this selection also creates an iCloud container and adds the Push Notifications capability. apple. I have added new record on iPad, but it didn't sync either. Select the CoreDataDemo target located at the top of the Project Navigator panel (marked A in Figure 51-1) so that the main panel displays the project settings. Specialized databases and zones also let you easily separate app information by access type or function. Pass the com. Click “Deploy Changes. First, update your container type to NSPersistentCloudKitContainer. Project33. CoreData. SwiftData の初心者向けに、基本的な使用方法と特徴を説明します。. Oct 18, 2023 · Oct 18, 2023. SwiftData relies on the expressivity provided by the new Swift language macros in order to create a seamless API experience. The option to use when detecting the container of the preferred CloudKit database. I added the container to my Xcode project. . 为了实现这个功能,你需要设置 ModelContainer 的配置,并打开 CloudKit 功能。. CloudKitを使う際の注意として、プロパティをoptionalにするかデフォルト値をセットする必要があります。 Within each CKContainer are multiple instances of CKDatabase. Scope = shared: If this is the NSPersistentCloudKitContainer . If you missed it, i've got an intro to Swift Data here, which walks you through the basics. Before the introduction of Core Data with CloudKit, third-party developers had already provided solutions to synchronize Core Data or other data objects (like realm) to CloudKit, most of which are still supported today. enter image description here Mar 30, 2021 · When Apple introduced changes to Core Data + CloudKit integration in 2019, they sold developers on a dead-simple API: add iCloud sync to your Core Data app with “as little as one line of code. Dec 21, 2023 · SwiftData with CloudKit is using/ build on top of NSPersistentCloudKitContainer. Try to use Messages because it’s easier to set up. A user might create a Note, and then tag it with a newly created tag “Family. Sep 30, 2023 · Updated for Xcode 15. In this video we are going to be adding CloudKit capabilities to our app so that all CRUD ac Mar 22, 2022 · First, to start using CloudKit in the app, we need to enable it in the project Signing and Capabilities section. xcode. I am attempting to configure CoreData+CloudKit using NSPersistentCloudKitContainer to automatically sync data to/from CloudKit. When you do this, Apple will create an iCloud container for you called something like iCloud. It works! The data sync's just fine. After few hours still no sync from iPhone to iPad. Once the app on a different device is Sep 22, 2023 · CloudKit+Core Data suddenly stopped syncing in production. This data should be available offline and should synced when online (Read and write) Data should be synced in all iOS devices. This is the 8th and penultimate video in this SwiftData series. com. Click + and add a new group, or select one you made previously. By organizing apps in containers, CloudKit ensures each app is siloed so its data won’t get entangled with other apps. CloudKit has been easy for a while, and now, its even easier. Enter any other project details and click Next. You share all the records in the zone by sharing the zone itself. Jun 19, 2023 · iOS17适配指南之SwiftData(一) 介绍. 14 Jan 6, 2024 · CKSyncEngineでデータをiCloudに同期する. Select the Use Core Data and Use CloudKit checkboxes. Select an action such as Run, and select the Arguments tab. You create a container using one of the class’s initializers or the corresponding SwiftUI view modifier. Sync SwiftData with iCloud using CloudKit. It lets us create custom objects, define how they link together, retrieve them with filtering and sorting, and even synchronize them to iCloud – and much more too. Working with relationships. At the time of this writing SwiftData only supported syncing with private database associated with the user. If you used Dec 20, 2020 · CloudKit は、ユーザが iCloud を通して端末間でデータを同期するための API を提供する Framework です。. 首先,确保你的应用已经开启了 iCloud 和 CloudKit 功能。. After few minutes one record was synced from iPad to iPhone. let cloudKitDatabase: ModelConfiguration. I think this is a view not refreshing issue, but am not 100% sure. swiftui. In iOS 17 SwiftData can express only a subset of NSPersistentCloudKitContainer's capabilities, and CloudKit sharing isn't one of them. To access the shared Cloudkit database with CKDatabase. eventChangedNotification. Core Data 的继承者,使用声明式的语法进行数据的持久化操作。 支持 CloudKit 同步,并且与 Core Data 兼容。 使用步骤. 987 Swift Beta performance: sorting arrays. Each container has a single public database accessible to all app users, and private databases for each user of your app. You can use a container per application or a single container to share data between multiple apps. And it is naturally integrated with SwiftUI and works with other platform features, like CloudKit and Widgets. Your data can be stored in files using DocumentGroup and synced via iCloud Drive, or you can use CloudKit to sync data between devices. CloudKitDatabase. Select a project template to use as the starting point for your project, and click Next. Mar 2, 2023 · CloudKit integration does not support unique constraints. Jun 26, 2023 · A Look into SwiftData. Select the Capabilities tab, then turn iCloud to ON and make sure the CloudKit box is checked. id" , cloudKitContainerIdentifier: "iCloud. export events by listing to NSPersistentCloudKitContainer. Here we can create a default container for the app. SwiftData uses the proven storage architecture of Core Data, so you can use both in the same app with the same underlying storage. gp kd nu ix by wa dm vp lp yk