gpt4 book ai didi

ios - 通过短信推荐 friend 时出现白屏

转载 作者:行者123 更新时间:2023-11-29 05:55:55 25 4
gpt4 key购买 nike

您好,我正在编写以下代码来通过短信推荐 friend 。

当我单击单元格时,短信应用程序会打开并显示文本,但当我再次尝试第二次时,它会显示白色屏幕。

这是我的代码

var controller1 = MFMessageComposeViewController()
extension ReferaFriendController:UICollectionViewDelegate,UICollectionViewDataSource,MFMessageComposeViewControllerDelegate
{
if indexPath.item == 0
{
if MFMessageComposeViewController.canSendText() {
let urlToShare = self.referalmodeldata[0].referralCodeOnly
controller1.body = "Hey I just gave an Awesome Assessment on App you can also try it. I scored , Try to beat my score \(String(describing: urlToShare))"
controller1.messageComposeDelegate = self
self.present(controller1, animated: true, completion: nil)
}
}
func messageComposeViewController(_ controller: MFMessageComposeViewController, didFinishWith result: MessageComposeResult) {
self.dismiss(animated: true, completion: nil)
}
}

最佳答案

据我所知,没有必要保留对 MFMessageComposeViewController 的引用。只需将其移至 if 闭包内您需要的位置即可创建:

if MFMessageComposeViewController.canSendText() {
let controller = MFMessageComposeViewController()
// ...
}

关于ios - 通过短信推荐 friend 时出现白屏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55157930/

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