cloudKit custom containers

I have two apps in development. I want to share a CloudKit container. I specified a custom continer in the second app to be the container of the first app. The second app still defaults to its default container even though a custom container is selected in the capabilities page. What do I need to do to get this to work?

Xcode 9.2 ios 11.2.5

You need to init your custom container as follow:


let container =  CKContainer(identifier: "yourContainerIdentifier")


Instead of :


let container = CKContainer.default()

Thank you Just what I needed.

Please, mark the answer as correct.

cloudKit custom containers
 
 
Q