I am attempting to use a UIActivityViewController to create a share menu using PDF data using the code below. (The type is 'Data', I also attempted NSData to no avail):
let activityViewController = UIActivityViewController(
activityItems: [documentData],
applicationActivities: nil)
It works fine on iPhone and iPad but when running on macOS I only get "More..."
By comparison here's how the exact same file behaves on iOS:
You need to save the data to a file and share the URL of that file.
let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!
let fileURL = documentsURL.appendingPathComponent("file.pdf")
try? pdfData.write(to: fileURL)
let activityController = UIActivityViewController(activityItems: [fileURL], applicationActivities: nil)
present(activityController, animated: true, completion: nil)