Swift iOS12:已弃用transitionController

Swift iOS12:已弃用transitionController,swift,viewcontroller,Swift,Viewcontroller,我有一个基于UIDocumentBrowser的应用程序,可以打开特定类型的文件。打开文件的默认转换是从底部滑动,这不是用户期望的最好的转换。在iOS 12之前,您可以使用这一部分进行缩放转换,现在也可以使用了,但是编译器抱怨使用了transitionController(forDocumentURL:),这是不推荐使用的。如何以iOS 12的方式实现这种效果 func presentDocument(at documentURL: URL) { let storyBoard = UIS

我有一个基于
UIDocumentBrowser
的应用程序,可以打开特定类型的文件。打开文件的默认转换是从底部滑动,这不是用户期望的最好的转换。在iOS 12之前,您可以使用这一部分进行缩放转换,现在也可以使用了,但是编译器抱怨使用了
transitionController(forDocumentURL:)
,这是不推荐使用的。如何以iOS 12的方式实现这种效果

func presentDocument(at documentURL: URL) {
    let storyBoard = UIStoryboard(name: "Main", bundle: nil)
    let documentViewController = storyBoard.instantiateViewController(withIdentifier: "MainViewController") as! MainViewController
    documentViewController.document = Document(fileURL: documentURL)
    // 
    documentViewController.transitioningDelegate = self
    let transitioningController = transitionController(forDocumentURL: documentURL)
    transitioningController.targetView = documentViewController.view
    self.transitioningController = transitioningController
    //
    present(documentViewController, animated: true, completion: nil)
}

我相信参数刚刚更改,您可以将
forDocumentURL
替换为:


我真粗心!谢谢,这不是你的错。通常情况下,弃用注释提供替换方法,但此处没有。另外,文档非常不完整(不仅缺少对替换方法的引用,新方法的文档也是空的;lol)。是的,我希望他们在下一个版本中解决这些问题。到Xcode 10.2 beta 4还没有。我已经提交了错误报告#48854007。
let transitioningController = transitionController(forDocumentAt: documentURL)