I want to show a toggle button inside alert
.alert(
Text("Create"),
isPresented: $showCreate
) {
Button("Cancel", role: .cancel) {
}
Button("Enter") {
//some function
}
TextField("Name", text: $Name)
TextField("Key (Optional)", text: $Key)
.keyboardType(.numberPad)
Toggle("permanent", isOn: $isPermanent)
} message: {
Text("Please enter details.")
}
it shows toggle as button named "permanent" in between cancel and enter button