Call completions immediately if the previous WebViewController was deallocated because the iPad was rotated. Issue #1757
This commit is contained in:
parent
df3c78b1c6
commit
a0f429448f
|
@ -93,11 +93,16 @@ class ImageTransition: NSObject, UIViewControllerAnimatedTransitioning {
|
||||||
animations: {
|
animations: {
|
||||||
imageView.frame = self.originFrame
|
imageView.frame = self.originFrame
|
||||||
}, completion: { _ in
|
}, completion: { _ in
|
||||||
self.webViewController?.showClickedImage() {
|
if let controller = self.webViewController {
|
||||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
|
controller.showClickedImage() {
|
||||||
imageView.removeFromSuperview()
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
|
||||||
transitionContext.completeTransition(true)
|
imageView.removeFromSuperview()
|
||||||
|
transitionContext.completeTransition(true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
imageView.removeFromSuperview()
|
||||||
|
transitionContext.completeTransition(true)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue