修复订单来源弹窗打开时的图片预览展示

This commit is contained in:
2026-07-07 11:14:57 +08:00
parent 187ba990d4
commit 3c25a0b789
4 changed files with 31 additions and 20 deletions

View File

@ -119,6 +119,30 @@ class BaseViewController: UIViewController {
navigationController?.popViewController(animated: true)
}
/// 沿 presentation Sheet present
func topMostPresentedViewController() -> UIViewController {
var top: UIViewController = self
while let presented = top.presentedViewController {
top = presented
}
return top
}
/// presentation
func presentOnTop(
_ viewController: UIViewController,
animated: Bool = true,
completion: (() -> Void)? = nil
) {
topMostPresentedViewController().present(viewController, animated: animated, completion: completion)
}
///
func presentImagePreview(imageURLs: [String], startIndex: Int) {
guard !imageURLs.isEmpty else { return }
presentOnTop(ImagePreviewViewController(imageURLs: imageURLs, startIndex: startIndex))
}
// MARK: - Notifications
private func registerBaseNotifications() {