Open ton252 opened 3 years ago
Hi @ton252! I will look into this early next week. Thank you for reporting!
May be It will help you. The problem is in presentationTransitionWillBegin method and in adjustPresentedViewFrame. If for example wrap this method in DispatchQueue.main.async this will fix the bug. Something like this:
override public func presentationTransitionWillBegin() {
guard let containerView = containerView else { return }
layoutBackgroundView(in: containerView)
layoutPresentedView(in: containerView)
configureScrollViewInsets()
guard let coordinator = presentedViewController.transitionCoordinator else {
backgroundView.dimState = .max
return
}
coordinator.animate(alongsideTransition: { [weak self] _ in
self?.backgroundView.dimState = .max
self?.presentedViewController.setNeedsStatusBarAppearanceUpdate()
})
// HotFix
DispatchQueue.main.asyncAfter(deadline: .now()) { [weak self] in
self?.adjustPresentedViewFrame()
}
}
I think the problem is in layout calculation cycle. Maybe adjustPresentedViewFrame needs to be called again in other places. I hope this will help you to find the bug
I've encountered the same issue. Have you guys already have a solution on this one?
@ton252 @lauraweaver Has the problem been solved
I've tried to present panviewcontroller without animation in example project and it doesn't work. For example if we change animated: true
to animated: false
it stops working