У меня есть приложение на основе 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)
}