我使用的是Swift(2.16.0)的最新版本的Material库。在我的项目中,我将NavigationDrawer控制器与ToolBarController用作根视图控制器。然后我尝试以模态呈现SearchBarController,动作动画效果完美
let searchController = AppStoryboard.Tree.viewController(viewControllerClass: SearchViewController.self)
let searchBarController = SearchBarController(rootViewController: searchController)
searchBarController.isMotionEnabled = true
searchBarController.motionTransitionType = .autoReverse(presenting: .fade)
toolbarController?.present(searchBarController, animated: true)
但是在日志中,我看到消息:
Unbalanced calls to begin/end appearance transitions for <Material.SearchBarController: 0x7f8db554bde0>.
Unbalanced calls to begin/end appearance transitions for <NavigationDrawerController: 0x7f8db680b000>.
我知道,Motion库具有transition(to: <UIViewController>)
方法。但是这种方法对我不起作用,因为它代替了rootViewController