Am trying to add a file uploader to my iPhone app in Swift, and need help as am unsure how to save the data from returned from the UIDocumentPickerViewController.
My whole document picking code works, and ends with this line of code:
let data = try Data.init(contentsOf: url)
The thing is I don't do my uploading till the user clicks another button, so I need to save that data. but am unsure how to cast a variable to hold it, then release the original data, and then finally free the copy.
I thought this would work
var dataToSend : AnyObject?
but it doesn't
Yes, still have casting issues to learn in Swift