We'll take you through the latest updates to CloudKit Console and discover how you can explore and debug your containers on the web like never before. Learn more about Act as iCloud, which helps you query records and view data from the perspective of another account. Discover how to share zones of records, and provide better collaboration between participants. And find out how to hide inactive containers. We'll also share a few tips on getting the most out of CloudKit Console.
To get the most out of this session, we recommend having basic knowledge of CloudKit containers.
♪ Mellow instrumental hip-hop music ♪ ♪ Hi, I'm Alex Young, and I'm an engineer on the iCloud developer experience team. CloudKit is an easy way to create great experiences by allowing users to effortlessly synchronize data between devices. CloudKit Console helps to make this even easier by providing tools that let you work with your app's schema and data. I'm going to share several updates to CloudKit Console that will help you understand and debug your application's schema and data. First, I'll walk through how to use hidden containers, then dive into a new way you can view records using iCloud accounts, and finally, there are some great updates for working with shared zones. It's common to create lots of containers while in development, and only focus on a few later on. You can better organize this with the new hidden containers feature. In CloudKit Console, you can choose which containers are hidden or visible. Hidden containers aren't just hidden from the lists inside the Console, but also across all developer tools, including Xcode. Even better, when a container is hidden, it applies at the team level, which means all of your test and prototype containers no longer clutter your teammates' views. I'll open the Console and use this new functionality now. Once you're signed in to the Console, open the container selector from the top-level navigation. Then click Manage Containers. This displays a new menu that allows you to toggle the visibility of every container in the current team. For people with several teams, you can switch between them using the account menu in the top right. Then you can go on to hide containers in your other teams as well. Here's the container from WWDC21, which isn't needed anymore. I can hide it, like this. And if you refresh the container list in Xcode, you'll see the containers are now hidden there too. I'll tell you about a new addition to the Console that lets you view data as iCloud accounts instead of your developer account. This is called Act As iCloud. Sometimes, it can be difficult to understand why certain users are experiencing trouble with data in their private databases. Now you have the ability to sign in as a separate iCloud account to view private data. When you're logged in with an iCloud account, CloudKit Console's query tools work as you'd expect from the perspective of that account. This helps you debug development and production issues on behalf of your users. I'll demonstrate this in the Console to illustrate how it works. This query was performed using my developer account. I'm going to switch to an iCloud account to show how the query results change. First, navigate to the Act As iCloud account menu item. This will open a dialog that allows you to sign in as an iCloud account. When I sign in, the context of the Console is going to change. Now you'll see a banner at the top of the page. All subsequent operations will be performed using the iCloud account instead of your developer account. You can query records and view zones, but you cannot perform schema operations. As you can see, the results of this query are for my iCloud account, not my developer account. Switching to another container or environment will stop acting as the iCloud account. You can also click the button in the banner to stop the Act As session. Remember, acting as an iCloud account applies to records, not schema, so this feature only works in the data parts of the Console. Attempting to access schema will halt the Act As session. This feature helps you to better understand how your data is used in production and investigate data-related bugs more effectively. Encrypted fields remain unreadable to you when acting as another account. Only the original user who owns the data can decrypt it. This is by design and helps iCloud maintain a high level of security and privacy and ensures that sensitive data stays safe. Next, I'll show you how to share zones in the Console. CloudKit sharing is a safe way to securely share records between users of your app. This is sharing done securely, using permissions that allow your app to determine a participant's read and write access. Participant access is further controlled by defining shares as public or private. Zone sharing works by applying rules to every record in a zone. A shared zone has a CloudKit share record that contains the options for accessing each record in the zone. Shared zones cannot have existing shared records. The standard public and private zone sharing options are supported by shared zones. A public shared zone makes every record visible to everyone who has the share code. Anyone with the short share code can join this share. This is ideal for records that should be easy to share between users without strict access control. Private shared zones have an additional layer of security because members must be in the participant list to join the share. CloudKit Console has several new tools for creating and viewing zone shares, to help you better understand shared zones and work with them during development and production. Let's create a zone share now so you can learn how it works. Navigate to Zones, then select a zone that you want to share. Click the Configure zone wide sharing... button in the details view. This shows a form that lets you decide if you want a public or private share. Public zones have an additional permission option for creating read-only or read/write shares. For private shares, the permissions are defined at a participant level. I'm going to create a private share, like this.
Once the zone is shared, you will see a short unique ID that can be sent to participants to join the share. Shared zones can be joined in the console by using the Accept Shared Record menu option found in the Records page. Now any record created in this zone will be automatically shared. Now that you've seen these updates to CloudKit Console, go and tidy up your container lists by hiding containers, try out Act As iCloud so you can see records with different iCloud accounts, and try out zone sharing for easier sharing of multiple records. We hope these tools enable you to better understand your schema, debug issues in your apps, and make CloudKit a little easier to work with. Thanks, and have a great WWDC. ♪
Looking for something specific? Enter a topic above and jump straight to the good stuff.
An error occurred when submitting your query. Please check your Internet connection and try again.