Using the PDFKit I have created a pdf document within my app. I can successfully show it in a preview and from the preview controller I use the following code to present the user the share actions:
@objc func shareAction(_ sender: UIBarButtonItem)
{
if let data = documentData
{
let vc = UIActivityViewController(activityItems: [data], applicationActivities: [])
present(vc, animated: true, completion: nil
}
}
documentData
contains the created pdf document.
When the user selects "Save to Files" the document gets the default name "PDF Document.pdf", which the user can change.
How can I provide a different default filename ?