UIAlertController 和屏幕方向改变

UIAlertController and screen orientation change

我正在使用带有弹出箭头的 UIAlertController。当我旋转屏幕方向时,弹出框箭头和弹出框位于错误的位置。如何在方向更改后将其位置更新到正确的位置?

方向改变是使用过渡协调器。

我使用协调器来确保转换在更新动作sheets 帧之前结束。

    func animateAlongsideTransition(in: UIView?, animation: (UIViewControllerTransitionCoordinatorContext) -> Void)?, completion: (UIViewControllerTransitionCoordinatorContext) -> Void)? = nil)

在完成块中,我重新创建了弹出操作 sheet。