Ios UIPopOverPresentationController在presentationTransitionWillBegin上崩溃
我收到苹果公司这样的崩溃: 正如Xcode所预期的那样,崩溃报告是如此糟糕,以至于我不得不猜测在我的代码中这是从哪里来的 坠机事件是关于爆米花的。在我的代码中,只有“共享”这个东西,当我在一个显示文档文件夹中文件的表视图上执行这些“删除”和“共享”拖尾滑动操作时,我才有了popoverIos UIPopOverPresentationController在presentationTransitionWillBegin上崩溃,ios,swift,xcode,crash,uipopovercontroller,Ios,Swift,Xcode,Crash,Uipopovercontroller,我收到苹果公司这样的崩溃: 正如Xcode所预期的那样,崩溃报告是如此糟糕,以至于我不得不猜测在我的代码中这是从哪里来的 坠机事件是关于爆米花的。在我的代码中,只有“共享”这个东西,当我在一个显示文档文件夹中文件的表视图上执行这些“删除”和“共享”拖尾滑动操作时,我才有了popover override func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: I
override func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
let delete = ... bla bla bla
let share = UIContextualAction(style: .normal, title: "") {[weak self] (contextualAction, view, boolValue) in
let oneFile = self?.files![indexPath.section]![indexPath.row]
let activityViewController = UIActivityViewController(
activityItems: ["Check out these files.", (oneFile?.url)! as URL],
applicationActivities: nil
)
activityViewController.popoverPresentationController?.sourceView = self?.view
self?.present(activityViewController, animated: true, completion: {[weak self] in
self?.tableView.setEditing(false, animated: true)
})
}
let swipeActions = UISwipeActionsConfiguration(actions: [delete,share])
swipeActions.performsFirstActionWithFullSwipe = true
return swipeActions
}
你们在这里看到的任何东西都可能导致这次事故吗
报告显示这在iPad上崩溃了,但我测试了一下,它工作正常。您应该定义
popoverPresentationController的sourceRect
和sourceView
,您应该定义popoverPresentationController的sourceRect
和sourceView