How do I access CloudKit from a private framework that Siri can access?

The documentation https://developer.apple.com/documentation/sirikit/structuring_your_code_to_support_app_extensions says to put my back-end services in a private framework. I created a Cocoa Touch Framework project, but there are no options to set Capabilities for the framework target like in other project types. I need to use CloudKit in my back-end service. How would I make this happen?

Replies

Set the capabilities you need on the executable targets, like the main app and app extension targets. Since the framework code can be called from multiple different entry points, like the main app or a SiriKit extension, each with different available capabilities,

the capabilities settings can't be shared in a framework and must be tied to the specific target that will use the framework.

How do I tie the framework to a specific target?

Is this still within the context of a SiriKit extension?


Tying a framework to only one target reduces the benefits of using a framework in the first place, which is to share code between multiple targets. If you only need the code in the framework for the one target, using a framework may not make sense.