gpt4 book ai didi

ios - Swift:UIActivityViewController 为空

转载 作者:行者123 更新时间:2023-11-28 13:14:47 25 4
gpt4 key购买 nike

我正在尝试创建 UIActivityViewController。但它看起来是空的,只有“复制”。没有 Twitter,没有 Facebook……为什么会这样?代码太简单了,我什至不知道我做错了什么。你能帮帮我吗?

@IBAction func shareButtonPressed(sender: AnyObject) {
let textToShare: String! = "GHJFGEgkjfgejkw"
let activityViewController: UIActivityViewController = UIActivityViewController(activityItems: [textToShare], applicationActivities: nil)
activityViewController.excludedActivityTypes = [UIActivityTypeAirDrop, UIActivityTypeMessage, UIActivityTypeMail, UIActivityTypePostToTwitter, UIActivityTypePostToFacebook]
self.presentViewController(activityViewController, animated: true, completion: nil)
}

最佳答案

刚刚发现可能会出现问题,因为 UIActivityViewController 不拥有 activityItems 数组。因此,当您执行分享操作时,请确保它保留在内存中

关于ios - Swift:UIActivityViewController 为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29451160/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com