How to store and retrieve data from iCloud?

in my app, I saved my data to iPhone FileSystem, but I realized that once I lost the phone the data was gone, so I was thinking about moving the important data to iCloud storge? How can I do that?

I am using the below URL to acess the local iPhone File System.


static let DocumentsDirectory = FileManager().urls(for: .documentDirectory, in: .userDomainMask).first!

Replies

You can't use iCloud in that example with Xcode free provisioning.


Pls. reread the free provisioning process I linked in your other thread.