📜  swiftui actionsheet - Swift 代码示例

📅  最后修改于: 2022-03-11 15:01:02.659000             🧑  作者: Mango

代码示例1
.actionSheet(isPresented: $showingActionSheet) {
    ActionSheet(title: Text("Change background"), message: Text("Select a new color"), buttons: [
        .default(Text("Red")) { self.backgroundColor = .red },
        .default(Text("Green")) { self.backgroundColor = .green },
        .default(Text("Blue")) { self.backgroundColor = .blue },
        .cancel()
    ])
}