Introduction to CloudKit

Introduction to CloudKit

As it turns out, many young developers have never created applications in the iOS Developer Center. Showing how to do it seems like a good idea, so I decided to prepare presentation about CloudKit and kill two birds with one stone.

CloudKit for beginners

At the beginning, you need to dedicate a little time to the iOS Developer Center. You should:

  • create an App ID for the new application
  • add development Provisioning Profile
  • create iCloud container.

App ID

We start by creating App ID, so go to https://developer.apple.com/account/ and there log in with your email and password. If you do not have a password you will need to create it and subscribe for a year for $100.

When you are logged in, select “Certificates, Identifiers & Profiles” and then from the left-sided menu: “App IDs”. Here you will see a list of all App IDs assigned to the account.

To create a new one you need to click plus icon, located above the top right corner of the table. On the next screen, you will need to submit application data:

  • application name,
  • bundle ID, that is the identifier of the application,
  • services – we turn on iCloud.

You can choose the name and Bundle ID of the application.

Then turn on iCloud service, and, obviously, CloudKit support. Click Continue and then Register.

Your App ID is now created, but you can see that iCloud service displays a warning. That is because no Container is selected, but we will come back to that later on.

Provisiong profile

Now we need to create provisioning profile, which will enable us to develop application. It’s all very similar – click “Provisioning Profiles”, then “Development”, then plus icon. Select “iOS App Development” and click “Continue”.

On the next screen, select the previously created App ID, the certificate, the profile to be used, then the device, and at the end give a name to the profile. That is all you need to do in the iOS Developer Center.

We can move to XCode. From the top bar, select File -> New -> Project… -> Single View Application. You will now see a screen with several form fields: give the name, paste Bundle ID you created earlier, choose any language – Swift and the device, click “Next” and choose a place where Xcode is to create a project file.

Now you can create a container by going to Project -> Selecting the right target -> Capabilities, and turn on CloudKit. Xcode may have a problem with a container – if that happens click Fix the issue, that will create a container for you. If this does not help, you need to select Specify custom containers and click plus icon, type the name of the container and click OK – it will now be created.

That’s it for the introduction. In the next post, I will discuss classes and show you some code.

Bartek

Bartek Byra

iOS Developer

Learn more

How to Send iOS Notifications in Different Languages? Guide to Dynamic Localization

The best way to set a connection between a user, provider, and an app? System notifications. They allow users to get the latest news in no time. This solution is easy to implement in apps dedicated to one market. But it gets complicated when the messages must be displayed in many languages. In such cases, the dynamic localization of remote notifications can be a real game-changer.

Read more

Promises on the Example of PromiseKit in Objective-C

Sooner or later every programmer encounters the problem of synchronous execution of certain actions. For example: get user information from the API, parse server response, save data to the database, update the view, and many others. To make it even more, at some of these stages you still need to deal with error handling. What should you do exactly?

Read more

Project estimation

Let us know what product you want to build and how we can help you.

Why choose us?

Logo Mobile Trends Awards

Mobile Trends Awards 2021

Winning app in
EVERYDAY LIFE

Nagroda Legalnych Bukmacherów

Legal Bookmakers Award 2019

Best Mobile App

Mobile Trends Awards logo

Mobile Trends Awards 2023

Winning app in MCOMMERCE DEVELOPMENT

23

client reviews

Clutch logo