Xcode 用于在警报()中显示图像的SwiftUI扩展

Xcode 用于在警报()中显示图像的SwiftUI扩展,xcode,image,swiftui,alert,Xcode,Image,Swiftui,Alert,在SwiftUI中,标准警报具有以下操作: public struct Alert { /// Creates an alert with one button. public init(title: Text, message: Text? = nil, dismissButton: Alert.Button? = nil) /// Creates an alert with two buttons. /// The system determines the visual ordering

在SwiftUI中,标准警报具有以下操作:

public struct Alert {
/// Creates an alert with one button.
public init(title: Text, message: Text? = nil, dismissButton: Alert.Button? = nil)

/// Creates an alert with two buttons.
/// The system determines the visual ordering of the buttons.
public init(title: Text, message: Text? = nil, primaryButton: Alert.Button, secondaryButton: Alert.Button)
 }
是否有一种方法可以编写此警报的扩展,允许我在标题和消息之间添加图像,以便我可以像这样使用它:

警报(标题:“title”,图像:“image.png”,消息:“消息文本”,dismissButton:Alert.Button)

或者我必须为此创建自己的AlertController