【发布时间】:2017-08-08 20:07:31
【问题描述】:
当我展示一个 UIActivityView 控制器时,我的应用程序崩溃了
libc++abi.dylib: terminating with uncaught exception of type NSException
但如果我指定 popoverPresentationController,应用程序不会崩溃。但是,它没有显示从底部滑入的动画。相反,它只是在左上角弹出。
let vc = UIActivityViewController(activityItems: [shareText], applicationActivities: [])
vc.popoverPresentationController?.sourceView = self.view
present(vc, animated: true, completion: nil)
关于我可以做些什么来确保它仍然保留从底部滑入的默认动画有什么想法吗?
【问题讨论】:
-
检查你是否在主线程上展示这个
-
不起作用:/
-
尝试在我的代码中删除
vc.modalPresentationStyle = .popover没有那个 -
它和它下面的行允许应用程序工作。如果我把它们拿出来,应用程序就会崩溃。
标签: ios swift uiactivityviewcontroller