1 year ago

#145388

test-img

Ethan Kay

How to add CloudKit to a Swift Playground app

Is it possible to add CloudKit to a Mac Swift Playground app? The simplicity of the Playground app is great for development, but I can't find a way to setup entitlements beyond what's provided in the GUI.

I'm open to something somewhat hacky, like using Package.swift additionalInfoPlistContentFilePath. The only reference I've seen to this is a twitter thread, which suggested this is not a possible route. Ideally there would be something similar to this that worked for entitlements, like additionalEntitlementInfoPlistContentFilePath.

My current method requires keeping a <project>.swiftpm alongside a <project>.xcodeproj, symlinking all non-cloudkit code between them, and enabling cloudkit on the xcodeproj option. This works, but of course has the draw back of maintaining both the xcodeproj and swiftpm project, and at that point I might as well just use the xcodeproj.

swift

xcode

swift-playground

swift-package-manager

0 Answers

Your Answer

Accepted video resources