CloudKit Dashboard

RSS for tag

Monitor and manage the CloudKit database containers used by your apps.

Posts under CloudKit Dashboard tag

88 Posts

Post

Replies

Boosts

Views

Activity

Current CloudKit pricing?
I've found old forum posts that reference CloudKit pricing based on usage (after exceeding the 'Free' tier). However, it doesn't seem that Apple has any information on any of their website that indicate what that pricing is, or otherwise the limits of a free tier. The closest I've found to this is on https://developer.apple.com/icloud/cloudkit/ where it says, "Store private data securely in your users’ iCloud accounts for limitless scale as your user base grows, and get up to 1PB of storage for your app’s public data." So does this mean that the only CloudKit limits now are: Private data: dependent on individual user's remaining iCloud storage space Public data: 1 PB Request count/day: unlimited Download usage/day: unlimited I'm being a little sarcastic, but at the same time, if there are still limits and a pricing structure, I'm really scratching my head as to why that doesn't seem to be published anywhere. Ultimately, I'm trying to find the best, reliable public asset storage with cross-device usage (iOS, tvOS) solution and am weighing CloudKit versus other cloud storage solutions and their costs. Side note: I'm kinda confused why CloudKit provides public asset storage in the first place, since I thought On-Demand Resources was intended to fill that gap (and ODR does have storage limits too).
5
1
7.5k
Sep ’23
Overide App name in iCloud "Manage Storage" list
In our team we have two apps A and B, unfortunately app B was released with iCloud entitlement with selected container ID of the app A. It lead to a problem that our app A displays in iCloud "Manage Storage" list on iOS as app B. Because of that people are loosing all of theirs data as they thing it is app A. App B stores uses only Key-Value storage in iCloud How can we override that name so it displays A again?
1
1
835
Aug ’23
Limits of CloudKit Public Database
Hello! I would like my users to save short videos (under 30seconds 1080p) to the public database for all other users to download and view. Is this possible? Will I run into any storage pricing with Apple if I were to pursue this as my application backend? I am looking at other methods as well (user sharing from their private database) so I can implement video sharing. Is this feasible and worth pursuing?
2
0
1.7k
Jul ’23
Are there ways to delete custom record types from CloudKit Dashboard?
I need to delete record types in the CloudKit Container. I tried clicking on "Delete Record Type" button at the bottom, but I can't click it. It won't let me delete them. I looked everywhere on the Dashboard for help, but I could not find any ways to delete them. The container is already deployed to production. Is there any way to delete the record types?
1
0
812
May ’23
CloudKit Zones Without Records
Hello, I'm using CloudKit for sharing CoreData objects. In my app, any time a user share an object (that previously doesn't has shared) I create a new sharing zone with the CKRecord. Also I'm using UICloudSharingController, so in this page when the user select "Stop sharing" (from the UICloudSharingController) it works, and all the items created in this Zone persist on it. I have two questions or doubts: When I delete all the items in the zone, the zone doesn't delete it self. So I have many Zones wihout items. I have to delete manually detecting what are the last item on it? If I don't want to share this (I stop sharing), exist any "easy" way to move all the items to my "default zone"? Thanks in advance, David
1
0
852
Mar ’23
CloudKit Zones Limit
Hello, I'm going to implement CloudKit for my project, allowing the users share data. At this moment, I'm researching the Apple project (link below) and documentation for this purpose, and I see many times "CloudKit has a limit on how many zones a database can have." So I have doubts about what is this limit. For my purpose, each user will share 10/15 objects (imagine posts with: title, notes and photos) as maximum. This zone limit is per user? I have to worry about this limit with my expected usage of sharing / per user? The apple project: https://developer.apple.com/documentation/coredata/sharing_core_data_objects_between_icloud_users Thanks in advance, David
0
0
951
Mar ’23
CloudKit Public Database index generation is slow丨CloudKit 公共数据库索引生成非常缓慢
My App is an App based on CloudKit technology that helps users match each other in real time, so it relies heavily on CloudKit's service stability. One of the problems that happened in the past few days is that CloudKit's public database index generation became very slow, and the data generated by one user could be queried by another user in a few seconds before, now it takes nearly a minute. This makes it impossible for my app users to do real-time matching with this technology. Using an AppleID, create a CKRecord containing several items of data, save it to the defaultZone of the public database, and create QueryIndex for these items. Immediately use another AppleID to Query this record in the defaultZone with these data. Check how long to wait before this record is queried. Under normal circumstances, the database index should be built very quickly, taking less than 5 seconds to query the corresponding record. In fact this process is currently becoming so slow that I am currently spending up to a minute waiting to query this record. Besides, my app is mainly operated in China, please also check if only Guizhou on the Cloud will have such problem. ----- Chinese Translate 我的 App 是一个基于 CloudKit 技术,帮助用户实时互相匹配的 App。所以非常依赖 CloudKit 的服务稳定性 这几天发生的一个问题是,CloudKit 的公共数据库索引生成变得非常缓慢,之前一个用户生成的数据,另一个用户几秒钟就可以查询到,现在需要花费近1分钟 这就导致我的 App 用户无法通过这个技术完成实时匹配了 使用一个 AppleID,创建一个包含了几项数据的 CKRecord,保存到公共数据库的 defaultZone,并创建这几个数据的 QueryIndex 立即使用另一个 AppleID,在 defaultZone 中使用这几项数据 Query 这个 record 检查需要等待多久,这个 record 才会被查询到 正常情况下,数据库的索引建立应该很快,只需要花费不到5秒就可以 Query 到对应 record 实际上这个过程目前变得非常缓慢,我目前需要花费长达1分钟的等待时间才能查询到这个 record 另外我的 App 主要在中国运营,也请检查是不是只有云上贵州会有这样的问题
2
1
1.6k
Mar ’23
CloudKit get ( Request failed with http status code 500 ) response
I launch my app on App Store by APP ID 1660030802. This data saved on CloudKit private database I use another account to download to use but I got the response called 「Request failed with http status code 500」 I try to use my developer account to download same APP, I can use and no show this error response. So I would to figure another can't not use private database and show 500 error code when I query the data in private database?
0
0
896
Jan ’23
Core Data + CloudKit - data record type does not appear in CloudKit Dashboard
I created a blank SwiftUI project and included Core Data and Cloud Kit. By selecting Core Data and CloudKit while creating the project, Apple already included some Core Data sample code and entities in the project, and also a Persistence.swift file that contained NSPersistentCloudKitContainer code. The sample code included a SwiftUI list in ContentView, with an "Add" button to add timestamp to the list when pressing. **I suppose after some basic setup to the project and created the CloudKit container, the app data will auto sync and can be viewed in CloudKit dashboard, but it didn't. ** Here is what I have setup: Created the project with Core Data and Cloud Kit Haven't touch any code from the Persistence.swift file since Apple has already set it up. Also haven't touch the app struct, content view and core data entities (left all sample code untouched) Selected Automatically Manage Signing and Development Team, with a paid developer acc. Added iCloud Capability Selected CloudKit in iCloud Capability, Created CloudKit Container. Added Background Modes Capability and selected Remote Notification. And then: Launch simulator, launch app, being asked to sign in with Apple ID, and did so. Add some timestamps into SwiftUI list. Kill app and relaunch, the timestamps are still there, even del app and reinstall. Core Data sample code works perfectly. Went to the related container of CloudKit Dashboard, selected Records, Private Database, There are only "Users" in Record Type. No other record types were shown. There are some log but is too long to post here, and this is the link: https://stackoverflow.com/questions/73841882/core-data-cloud-kit-data-record-type-does-not-appear-in-cloudkit-dashboard Am I missing something?
2
0
1.9k
Oct ’22
No ModifedAt Index in CloudKit
Hi, I do not see an option to add 'modifiedAt' as an index to a record in a public database in CloudKit. I've added the modifiedTimsestamp index for both QUERYABLE and SORTABLE but that doesn't seem to be loading the Public database as expected. I can write to it just fine. I can't find any documentation stating that modifiedAt has been deprecated in favor of something else. The only thing I can find is this video from WWDC2020 on how to configure a Public database: https://developer.apple.com/videos/play/wwdc2020/10650/ I've been following along with Donny Wals CoreData book in attempting to learn this stuff. Any help would be greatly appreciated. Thanks Edit: I should probably mention I have reset the environment numerous times. I seem to share some of the pain in this post: https://developer.apple.com/forums/thread/682698
1
1
1.9k
Sep ’22
CloudKit deploy shows unchanged fields with `unknownType`
I reset my Development environment to match Production. Then I added a new field of type Asset. Attempting to deploy to Production shows 22 field changes and 12 index changes, with the field types being marked unknownType. The diff view shows the correct attribute types, but also reflects the proposed removal of indices. I'm hesitant to push to Production because iI worry my field types will be removed and my current users will see errors. Has anyone seen this before? Anyone know if this is a bug?
2
2
1.8k
Sep ’22
Updating Production Records In Public CloudKit Database From Console
Simple question I think, I am looking at using CloudKit instead of setting up my own server for my next app. I want to use the public database to store a list of articles that I create and the users can read. Can these articles be created/managed/edited from within the Cloudkit Console? I have seen on the video that CloudKit development records can be accessed but can I also access the records that are in production? I want to be able to login to console and add a new record to the production database but not sure if this is possible. Thanks
1
0
1.5k
Aug ’22
CloudKit Console: Containers do not appear
I am new to CloudKit - and my test on the Mac (Swift, M1, Monterey, XCode 14 Beta 4) which creates records appears to be working. However, when I log into the CloudKit Console, using the same account as the iCloud account my Mac is logged into, no containers appear. I have tried this several times over 2 days, and no containers appear in the console. The container I am using appears in iCloud storage (via System Preferences > iCloud > Manage), so it appears to be there on iCloud. Am I doing something wrong? What I want to do is query the data, which, I understand, you must use the Console to make it queryable. (It would be nice to be able to do this programmatically, but haven't found a way yet). Thank you.
1
2
1.4k
Aug ’22
CloudKit Dashboard Development Environment Deleting Indexes
I'm trying to modify a CloudKit record type on my dev env but every time I add a field all my indexes get deleted leaving only the basic ones. I have tried resetting multiple times (losing all the test data along with it, very annoying) but it just keeps deleting indexes and sometimes record fields too. This is preventing me to test on the dev environment, and since all the indexes get deleted it also prevents me from pushing the changes to the production environment without readding all the indexes back manually again. Is this a bug on CloudKit dashboard? How can I fix this?
2
1
1.1k
Jul ’22
Loading large number of records into the CloudKit public database
Anyone know how to load a large number of records into the CloudKit public database? I need to load 1.2million records (about 150Mb) into the public database. no binary data. basically just a bunch of exchange rates that I need to have available to all my users. I've been trying for months. have tried: loading into core data on a device or simulator individually or in batches ranging from 400 records to 2500 (more than that exceeds batch size limits). it will start to sync and then stop. can often get it to restart by restarting device or similator but will eventually corrupt the database in iCloud requiring a reset of the environment. generally can get the load to go for a few days and load maybe 500k records before it breaks. to do that have to put delays up to a minute between batches loaded into core data. have tried doing it using the CloudKit.js framework and loading from a server. this works for a small number of records. but limits are really small doing it through that interface. after a while it locks you out. don't get anywhere near the number of records I need to load. I'm stuck. has anyone found a way? same issue on all versions of iOS - 14, 15, 16b1
2
1
1.9k
Jun ’22
CloudKit - CKRecord returning nil
Not sure what I am doing wrong here, but my "record" variable keeps returning "nil". When I run the savetoCloud() function, it crashes because record is "nil" (when it should have the data to be uploaded to CloudKit instead). Help please. I have this in a .swift file: import Foundation import CloudKit public class dbData: NSObject{ var record: CKRecord? var lightDB: Bool?{ didSet{ record!["Light"] = lightDB } } init(record: CKRecord){ self.record = record self.lightDB = self.record!["Light"] as? Bool } convenience init(light: Bool) { self.init(record: CKRecord(recordType: "Location", recordID: CKRecord.ID(recordName: UUID().uuidString))) self.lightDB = light } } And then this on the main View Controller: import UIKit import CloudKit class MapViewController: UIViewController { let publicDatabase = CKContainer(identifier: "iCloud.XXXX").database(with: .public) var dbdata: dbData? @IBOutlet weak var lightSW: UISwitch! override func viewDidLoad() { super.viewDidLoad() public func savetoCloud(){ let light = lightSW.isOn let record = self.dbdata?.record record!["Light"] = light self.dbdata?.record = record publicDatabase.save(record!) { (record, error) in if let error = error{ print("Error\(error.localizedDescription)") return } print("Record saved: \(record?.recordID.recordName ?? "")") } }
1
0
884
Apr ’22
Current CloudKit pricing?
I've found old forum posts that reference CloudKit pricing based on usage (after exceeding the 'Free' tier). However, it doesn't seem that Apple has any information on any of their website that indicate what that pricing is, or otherwise the limits of a free tier. The closest I've found to this is on https://developer.apple.com/icloud/cloudkit/ where it says, "Store private data securely in your users’ iCloud accounts for limitless scale as your user base grows, and get up to 1PB of storage for your app’s public data." So does this mean that the only CloudKit limits now are: Private data: dependent on individual user's remaining iCloud storage space Public data: 1 PB Request count/day: unlimited Download usage/day: unlimited I'm being a little sarcastic, but at the same time, if there are still limits and a pricing structure, I'm really scratching my head as to why that doesn't seem to be published anywhere. Ultimately, I'm trying to find the best, reliable public asset storage with cross-device usage (iOS, tvOS) solution and am weighing CloudKit versus other cloud storage solutions and their costs. Side note: I'm kinda confused why CloudKit provides public asset storage in the first place, since I thought On-Demand Resources was intended to fill that gap (and ODR does have storage limits too).
Replies
5
Boosts
1
Views
7.5k
Activity
Sep ’23
Overide App name in iCloud "Manage Storage" list
In our team we have two apps A and B, unfortunately app B was released with iCloud entitlement with selected container ID of the app A. It lead to a problem that our app A displays in iCloud "Manage Storage" list on iOS as app B. Because of that people are loosing all of theirs data as they thing it is app A. App B stores uses only Key-Value storage in iCloud How can we override that name so it displays A again?
Replies
1
Boosts
1
Views
835
Activity
Aug ’23
Limits of CloudKit Public Database
Hello! I would like my users to save short videos (under 30seconds 1080p) to the public database for all other users to download and view. Is this possible? Will I run into any storage pricing with Apple if I were to pursue this as my application backend? I am looking at other methods as well (user sharing from their private database) so I can implement video sharing. Is this feasible and worth pursuing?
Replies
2
Boosts
0
Views
1.7k
Activity
Jul ’23
Are there ways to delete custom record types from CloudKit Dashboard?
I need to delete record types in the CloudKit Container. I tried clicking on "Delete Record Type" button at the bottom, but I can't click it. It won't let me delete them. I looked everywhere on the Dashboard for help, but I could not find any ways to delete them. The container is already deployed to production. Is there any way to delete the record types?
Replies
1
Boosts
0
Views
812
Activity
May ’23
CloudKit Zones Without Records
Hello, I'm using CloudKit for sharing CoreData objects. In my app, any time a user share an object (that previously doesn't has shared) I create a new sharing zone with the CKRecord. Also I'm using UICloudSharingController, so in this page when the user select "Stop sharing" (from the UICloudSharingController) it works, and all the items created in this Zone persist on it. I have two questions or doubts: When I delete all the items in the zone, the zone doesn't delete it self. So I have many Zones wihout items. I have to delete manually detecting what are the last item on it? If I don't want to share this (I stop sharing), exist any "easy" way to move all the items to my "default zone"? Thanks in advance, David
Replies
1
Boosts
0
Views
852
Activity
Mar ’23
CloudKit Zones Limit
Hello, I'm going to implement CloudKit for my project, allowing the users share data. At this moment, I'm researching the Apple project (link below) and documentation for this purpose, and I see many times "CloudKit has a limit on how many zones a database can have." So I have doubts about what is this limit. For my purpose, each user will share 10/15 objects (imagine posts with: title, notes and photos) as maximum. This zone limit is per user? I have to worry about this limit with my expected usage of sharing / per user? The apple project: https://developer.apple.com/documentation/coredata/sharing_core_data_objects_between_icloud_users Thanks in advance, David
Replies
0
Boosts
0
Views
951
Activity
Mar ’23
CloudKit Public Database index generation is slow丨CloudKit 公共数据库索引生成非常缓慢
My App is an App based on CloudKit technology that helps users match each other in real time, so it relies heavily on CloudKit's service stability. One of the problems that happened in the past few days is that CloudKit's public database index generation became very slow, and the data generated by one user could be queried by another user in a few seconds before, now it takes nearly a minute. This makes it impossible for my app users to do real-time matching with this technology. Using an AppleID, create a CKRecord containing several items of data, save it to the defaultZone of the public database, and create QueryIndex for these items. Immediately use another AppleID to Query this record in the defaultZone with these data. Check how long to wait before this record is queried. Under normal circumstances, the database index should be built very quickly, taking less than 5 seconds to query the corresponding record. In fact this process is currently becoming so slow that I am currently spending up to a minute waiting to query this record. Besides, my app is mainly operated in China, please also check if only Guizhou on the Cloud will have such problem. ----- Chinese Translate 我的 App 是一个基于 CloudKit 技术,帮助用户实时互相匹配的 App。所以非常依赖 CloudKit 的服务稳定性 这几天发生的一个问题是,CloudKit 的公共数据库索引生成变得非常缓慢,之前一个用户生成的数据,另一个用户几秒钟就可以查询到,现在需要花费近1分钟 这就导致我的 App 用户无法通过这个技术完成实时匹配了 使用一个 AppleID,创建一个包含了几项数据的 CKRecord,保存到公共数据库的 defaultZone,并创建这几个数据的 QueryIndex 立即使用另一个 AppleID,在 defaultZone 中使用这几项数据 Query 这个 record 检查需要等待多久,这个 record 才会被查询到 正常情况下,数据库的索引建立应该很快,只需要花费不到5秒就可以 Query 到对应 record 实际上这个过程目前变得非常缓慢,我目前需要花费长达1分钟的等待时间才能查询到这个 record 另外我的 App 主要在中国运营,也请检查是不是只有云上贵州会有这样的问题
Replies
2
Boosts
1
Views
1.6k
Activity
Mar ’23
CloudKit get ( Request failed with http status code 500 ) response
I launch my app on App Store by APP ID 1660030802. This data saved on CloudKit private database I use another account to download to use but I got the response called 「Request failed with http status code 500」 I try to use my developer account to download same APP, I can use and no show this error response. So I would to figure another can't not use private database and show 500 error code when I query the data in private database?
Replies
0
Boosts
0
Views
896
Activity
Jan ’23
Core Data + CloudKit - data record type does not appear in CloudKit Dashboard
I created a blank SwiftUI project and included Core Data and Cloud Kit. By selecting Core Data and CloudKit while creating the project, Apple already included some Core Data sample code and entities in the project, and also a Persistence.swift file that contained NSPersistentCloudKitContainer code. The sample code included a SwiftUI list in ContentView, with an "Add" button to add timestamp to the list when pressing. **I suppose after some basic setup to the project and created the CloudKit container, the app data will auto sync and can be viewed in CloudKit dashboard, but it didn't. ** Here is what I have setup: Created the project with Core Data and Cloud Kit Haven't touch any code from the Persistence.swift file since Apple has already set it up. Also haven't touch the app struct, content view and core data entities (left all sample code untouched) Selected Automatically Manage Signing and Development Team, with a paid developer acc. Added iCloud Capability Selected CloudKit in iCloud Capability, Created CloudKit Container. Added Background Modes Capability and selected Remote Notification. And then: Launch simulator, launch app, being asked to sign in with Apple ID, and did so. Add some timestamps into SwiftUI list. Kill app and relaunch, the timestamps are still there, even del app and reinstall. Core Data sample code works perfectly. Went to the related container of CloudKit Dashboard, selected Records, Private Database, There are only "Users" in Record Type. No other record types were shown. There are some log but is too long to post here, and this is the link: https://stackoverflow.com/questions/73841882/core-data-cloud-kit-data-record-type-does-not-appear-in-cloudkit-dashboard Am I missing something?
Replies
2
Boosts
0
Views
1.9k
Activity
Oct ’22
No ModifedAt Index in CloudKit
Hi, I do not see an option to add 'modifiedAt' as an index to a record in a public database in CloudKit. I've added the modifiedTimsestamp index for both QUERYABLE and SORTABLE but that doesn't seem to be loading the Public database as expected. I can write to it just fine. I can't find any documentation stating that modifiedAt has been deprecated in favor of something else. The only thing I can find is this video from WWDC2020 on how to configure a Public database: https://developer.apple.com/videos/play/wwdc2020/10650/ I've been following along with Donny Wals CoreData book in attempting to learn this stuff. Any help would be greatly appreciated. Thanks Edit: I should probably mention I have reset the environment numerous times. I seem to share some of the pain in this post: https://developer.apple.com/forums/thread/682698
Replies
1
Boosts
1
Views
1.9k
Activity
Sep ’22
CloudKit deploy shows unchanged fields with `unknownType`
I reset my Development environment to match Production. Then I added a new field of type Asset. Attempting to deploy to Production shows 22 field changes and 12 index changes, with the field types being marked unknownType. The diff view shows the correct attribute types, but also reflects the proposed removal of indices. I'm hesitant to push to Production because iI worry my field types will be removed and my current users will see errors. Has anyone seen this before? Anyone know if this is a bug?
Replies
2
Boosts
2
Views
1.8k
Activity
Sep ’22
Updating Production Records In Public CloudKit Database From Console
Simple question I think, I am looking at using CloudKit instead of setting up my own server for my next app. I want to use the public database to store a list of articles that I create and the users can read. Can these articles be created/managed/edited from within the Cloudkit Console? I have seen on the video that CloudKit development records can be accessed but can I also access the records that are in production? I want to be able to login to console and add a new record to the production database but not sure if this is possible. Thanks
Replies
1
Boosts
0
Views
1.5k
Activity
Aug ’22
CloudKit Console: Containers do not appear
I am new to CloudKit - and my test on the Mac (Swift, M1, Monterey, XCode 14 Beta 4) which creates records appears to be working. However, when I log into the CloudKit Console, using the same account as the iCloud account my Mac is logged into, no containers appear. I have tried this several times over 2 days, and no containers appear in the console. The container I am using appears in iCloud storage (via System Preferences > iCloud > Manage), so it appears to be there on iCloud. Am I doing something wrong? What I want to do is query the data, which, I understand, you must use the Console to make it queryable. (It would be nice to be able to do this programmatically, but haven't found a way yet). Thank you.
Replies
1
Boosts
2
Views
1.4k
Activity
Aug ’22
CloudKit Dashboard Development Environment Deleting Indexes
I'm trying to modify a CloudKit record type on my dev env but every time I add a field all my indexes get deleted leaving only the basic ones. I have tried resetting multiple times (losing all the test data along with it, very annoying) but it just keeps deleting indexes and sometimes record fields too. This is preventing me to test on the dev environment, and since all the indexes get deleted it also prevents me from pushing the changes to the production environment without readding all the indexes back manually again. Is this a bug on CloudKit dashboard? How can I fix this?
Replies
2
Boosts
1
Views
1.1k
Activity
Jul ’22
Loading large number of records into the CloudKit public database
Anyone know how to load a large number of records into the CloudKit public database? I need to load 1.2million records (about 150Mb) into the public database. no binary data. basically just a bunch of exchange rates that I need to have available to all my users. I've been trying for months. have tried: loading into core data on a device or simulator individually or in batches ranging from 400 records to 2500 (more than that exceeds batch size limits). it will start to sync and then stop. can often get it to restart by restarting device or similator but will eventually corrupt the database in iCloud requiring a reset of the environment. generally can get the load to go for a few days and load maybe 500k records before it breaks. to do that have to put delays up to a minute between batches loaded into core data. have tried doing it using the CloudKit.js framework and loading from a server. this works for a small number of records. but limits are really small doing it through that interface. after a while it locks you out. don't get anywhere near the number of records I need to load. I'm stuck. has anyone found a way? same issue on all versions of iOS - 14, 15, 16b1
Replies
2
Boosts
1
Views
1.9k
Activity
Jun ’22
CloudKit - CKRecord returning nil
Not sure what I am doing wrong here, but my "record" variable keeps returning "nil". When I run the savetoCloud() function, it crashes because record is "nil" (when it should have the data to be uploaded to CloudKit instead). Help please. I have this in a .swift file: import Foundation import CloudKit public class dbData: NSObject{ var record: CKRecord? var lightDB: Bool?{ didSet{ record!["Light"] = lightDB } } init(record: CKRecord){ self.record = record self.lightDB = self.record!["Light"] as? Bool } convenience init(light: Bool) { self.init(record: CKRecord(recordType: "Location", recordID: CKRecord.ID(recordName: UUID().uuidString))) self.lightDB = light } } And then this on the main View Controller: import UIKit import CloudKit class MapViewController: UIViewController { let publicDatabase = CKContainer(identifier: "iCloud.XXXX").database(with: .public) var dbdata: dbData? @IBOutlet weak var lightSW: UISwitch! override func viewDidLoad() { super.viewDidLoad() public func savetoCloud(){ let light = lightSW.isOn let record = self.dbdata?.record record!["Light"] = light self.dbdata?.record = record publicDatabase.save(record!) { (record, error) in if let error = error{ print("Error\(error.localizedDescription)") return } print("Record saved: \(record?.recordID.recordName ?? "")") } }
Replies
1
Boosts
0
Views
884
Activity
Apr ’22