简体   繁体   中英

How to show file size and type in UIActivityViewController modal

To allow the user to download a file, I use the UIActivityViewController provided by Apple. The following code produces the first screenshot:

let url: URL = // some url
let activityViewController = UIActivityViewController(activityItems: [url, "A filename"], applicationActivities: nil)
present(activityViewController, animated: true, completion: nil)

上面的代码生成什么

However, it does not show the file type (pdf document) and size, as is shown in the screenshot below. All functions of the activity view work (downloading, mailing, etc).

Does anyone know how this information can be displayed using a UIActivityViewController ?

如果您下载 PDF 文档,Safari 会显示什么

您可以根据本主题实现功能或尝试为您的共享文件实现activityViewControllerLinkMetadata(_:)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM