How to save an audio file using Core Data + CloudKit?

I am transitioning to using CloudKit for syncing, using NSPersistentCloudKitContainer to manage syncing. In my app you can record audio, and I've been saving that by saving the file to disc and storing a relative URL to Core Data.

How can I get this to work using NSPersistentCloudKitContainer? I read that I shouldn't store large data as a CoreData attribute for performance, but I need the data to sync with CloudKit.

How do you managed to do this: "I've been saving that by saving the file to disc and storing a relative URL to Core Data."? I'm having a lot of problems with this.

How to save an audio file using Core Data + CloudKit?
 
 
Q