I want to select a pdf from icloud and convert it into base64 so that i can upload it to further .I have selected the file from icloud but i ab not able to convert it into base64
@IBAction func PdfBtn(_ sender: Any) {
let importMenu = UIDocumentMenuViewController(documentTypes: ["public.composite-content"], in: .import)
importMenu.delegate = self
present(importMenu, animated: true, completion: nil)
}
@available(iOS 8.0, *)
public func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentAt url: URL) {
let link = url as URL
print("The Url is : \(link)")
}
@available(iOS 8.0, *)
public func documentMenu(_ documentMenu: UIDocumentMenuViewController, didPickDocumentPicker documentPicker: UIDocumentPickerViewController) {
documentPicker.delegate = self
present(documentPicker, animated: true, completion: nil)
}
func documentPickerWasCancelled(_ controller: UIDocumentPickerViewController) {
print("we cancelled")
dismiss(animated: true, completion: nil)
}
please help .