【发布时间】:2018-04-11 23:24:07
【问题描述】:
我想为导航控制器实现自定义推送转换。
我首先实现了UINavigationControllerDelegate,其中我返回了UIViewControllerAnimatedTransitioning 的对象。
在本课程中,我想拍摄目标视图的快照,以便对其进行动画处理。但是,对于 push-segue,这不起作用 - 快照是空的。 [当我弹回来时,我设置了afterScreenUpdates = false,一切正常]
guard let fromVC = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.from),
let toVC = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.to) else {
return
}
guard let snapshot = toVC.view.snapshotView(afterScreenUpdates: true) else {
return }
// Problem:
// snapshot is an empty view!
【问题讨论】:
-
我也是这样,你解决了吗?
标签: ios swift uikit transition navigationcontroller