小编Mar*_*ela的帖子

UIActivityViewController 在共享文件后关闭当前视图控制器

UIActivityViewController 在共享文件后关闭呈现视图控制器。这仅在 iOS 13+ 中发生。有没有永久的解决方案?更新到 iOS 13 后,其他应用程序似乎也存在此问题。

   class VC : UIViewController {


   @IBAction func moveFiles(_ sender: UIButton) {

      let alertController = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)


    alertController.addAction(UIAlertAction(title: "Move", style: .default, handler: { action in

    let activityController = UIActivityViewController(activityItems: urls, applicationActivities: nil)


   if (UIDevice.current.userInterfaceIdiom == UIUserInterfaceIdiom.pad) {
   activityController.popoverPresentationController?.sourceRect = sender.frame
    activityController.popoverPresentationController?.sourceView = sender.superview
    }
   self.present(activityController, animated: true, completion: nil)


    }))




           }


     }
Run Code Online (Sandbox Code Playgroud)

iphone ipad ios swift

5
推荐指数
1
解决办法
1517
查看次数

标签 统计

ios ×1

ipad ×1

iphone ×1

swift ×1