Open VitoNYang opened 1 year ago
Seems like the view.layoutIfNeeded()
cause the width to incorrect
According to the clue from PR #199,
this issue is trigger by SheetViewController
's viewDidDisappear
method,
So, I think we can fix this by checking if whether presenttedviewcontroller is nil
public override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
// Add a guard statement to prevent unexpected dismiss
guard presentedViewController == nil else { return }
if let presenter = self.transition.presenter, self.options.shrinkPresentingViewController {
self.transition.restorePresentor(presenter, completion: { _ in
self.didDismiss?(self)
})
} else if !self.options.useInlineMode {
self.didDismiss?(self)
}
}
Presenting a ViewController with modalPresentationStyle = .fullScreen in a sheet view, when dismiss the ViewController will cause the width of the sheet view to be incorrect.