Same here. Filed as FB8915855.
Post
Replies
Boosts
Views
Activity
Still running into this today. It looks like this is fixed as of iOS 11.3, so to support older versions, I have this method in my UIPresentationController subclass:
internal func animateDimmingViewDisappearing() {
guard let dimmingView = dimmingView,
let transitionCoordinator = presentedViewController
.transitionCoordinator
else { return }
// Despite this API being available earlier, iOS 11.3 is the first OS
// that doesn’t just animate this instantly.
if #available(iOS 11.3, *) {
transitionCoordinator.animateAlongsideTransition(
in: dimmingView.superview,
animation: { _ in dimmingView.alpha = 0 },
completion: { _ in dimmingView.removeFromSuperview() }
)
} else {
UIView.beginAnimations("animateDimmingViewDisappearing",
context: nil)
if transitionCoordinator.transitionDuration > 0 {
UIView.setAnimationDuration(
transitionCoordinator.transitionDuration
)
}
else {
UIView.setAnimationDuration(1.0 / 3.0)
}
UIView.setAnimationCurve(transitionCoordinator.completionCurve)
dimmingView.alpha = 0
UIView.commitAnimations()
}
}