- In Xcode, click on your project in the navigator
- Select your target
- Go to "General" tab
- Scroll down to "Frameworks, Libraries, and Embedded Content"
- Click the "+" button
- Search for "CoreData.framework"
- Add it to your project
- In the same "Frameworks, Libraries, and Embedded Content" section
- Click the "+" button again
- Search for "CloudKit.framework"
- Add it to your project
- Right-click on your project folder in the navigator
- Select "New File..."
- Choose "Core Data" → "Data Model"
- Name it "BoxingScorecard"
- Make sure it's added to your target
Add these entries to your Info.plist file:
<key>com.apple.developer.icloud-container-identifiers</key>
<array>
<string>iCloud.com.yourname.BoxingScorecard</string>
</array>
<key>com.apple.developer.icloud-services</key>
<array>
<string>CloudKit</string>
</array>- Go to "Signing & Capabilities"
- Click "+" button
- Try searching for:
- "iCloud" (this includes CloudKit)
- "Data Model" or "Core Data Model"
- "Persistence" or "Data Storage"
If the above doesn't work, you can manually edit the project file:
- Right-click on your project file in Finder
- Select "Show Package Contents"
- Open
project.pbxprojin a text editor - Add these lines to your target's build settings:
USE_CORE_DATA = YES;
SYSTEM_FRAMEWORK_SEARCH_PATHS = "$(inherited)";
After adding the frameworks and model:
- Clean your project (Product → Clean Build Folder)
- Build your project (⌘+B)
- Check that there are no framework-related errors
If the above doesn't work, you can add Core Data and CloudKit via Swift Package Manager:
- File → Add Package Dependencies...
- Search for Apple's official packages
- Add CoreData and CloudKit packages
- Make sure you have the latest Xcode version
- Check that you have a valid Apple Developer account
- Try creating a new project and see if the capabilities appear there
- Restart Xcode
- Clean the build folder (Product → Clean Build Folder)
- Delete derived data (Window → Projects → Click arrow next to derived data)
- Restart Xcode
Once you've successfully added the capabilities:
- Configure your CloudKit container
- Set up your Core Data model
- Test the build
- Run the app in simulator
Note: The Core Data and CloudKit frameworks are part of iOS, so they should be available. If they're not showing up in the capabilities list, adding them as frameworks should work as an alternative.