Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/svn/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 共享按钮未在iMessage上共享_Ios_Uitableview - Fatal编程技术网

Ios 共享按钮未在iMessage上共享

Ios 共享按钮未在iMessage上共享,ios,uitableview,Ios,Uitableview,我试图实现一个共享按钮,允许通过文本消息共享表视图中的文章,但由于某些原因,当我在模拟器中运行它时,它不会复制链接,也不会显示在iPhone 8或8 plus上。我如何解决这个问题 @IBAction func shareButton(_ sender: UIButton) { let buttonPosition = sender.convert(CGPoint.zero, to: self.table_view) if let indexP

我试图实现一个共享按钮,允许通过文本消息共享表视图中的文章,但由于某些原因,当我在模拟器中运行它时,它不会复制链接,也不会显示在iPhone 8或8 plus上。我如何解决这个问题

@IBAction func shareButton(_ sender: UIButton) {
        
        let buttonPosition = sender.convert(CGPoint.zero, to: self.table_view)
        if let indexPath = self.table_view.indexPathForRow(at:buttonPosition) {
            let newRelease = articles?[indexPath.row].urlWebsite
            let activityVC = UIActivityViewController(activityItems:[newRelease ?? 0], applicationActivities: nil)
            activityVC.popoverPresentationController?.sourceView = self.view
            self.present(activityVC,animated: true, completion: nil)

        }