2
내비게이션 컨트롤러에 대한 사용자 정의 푸시 전환을 구현하고 싶습니다.snapshotView (afterScreenUpdates : true)가 빈 뷰를 반환합니다.
먼저 UINavigationControllerDelegate
을 구현했으며 여기서 객체는 UIViewControllerAnimatedTransitioning
입니다.
이 클래스에서는 대상 뷰의 스냅 샷을 애니메이트하려고합니다. 그러나 push-segue의 경우 스냅 샷이 비어 있습니다. [내가 다시 팝업 때 , 나는 afterScreenUpdates = false
를 설정하고 모든 작동] -snapshotViewAfterScreenUpdates에 대한 사실 공급
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!
"실제로는 이미지를 그릴 때 runloop으로 되돌아 가야한다는 것을 의미합니다 *"- 이것을 달성하는 방법에 대한 힌트가 있습니까? – Pascal
@Pascal true를 사용하여이 작업을 수행 할 수 있지만 이미지를 즉시 보려는 경우 -snapshotViewAfterScreenUpdates에 false를 사용해야합니다. – SergStav