在使用UIActivityViewController共享从Firebase下载的图像时需要一些帮助。我的当前设置仅在呈现UIActivityViewController时显示“更多”选项。没有其他任何内容可用于股票期权。
let shareAction = UIAlertAction(title: "Share", style: UIAlertActionStyle.default, handler: {(alert: UIAlertAction!) in
var items:[Any] = []
let titlePost = self.feeds[sender.tag].downloadURL
let ref = Storage.storage().reference(forURL: titlePost)
ref.getData(maxSize: 2 * 1024 * 1024, completion: {(data, error) in
if error != nil {
print("image could not be downloaded")
} else {
if let imgData = data {
if let img = UIImage(data: imgData) {
self.image = img
items.append(img)
print("image downloaded")
}
}
}
})
let activityViewController = UIActivityViewController(activityItems: items, applicationActivities: nil)
self.present(activityViewController, animated: true, completion: nil)
})