I am attempting to trigger an action within a dynamic island by pressing a button, but the button is not functioning and no action is being executed.
dynamicIsland: { context in
DynamicIsland {
// Expanded UI goes here. Compose the expanded UI through
// various regions, like leading/trailing/center/bottom
DynamicIslandExpandedRegion(.leading) {
Text("Leading")
}
DynamicIslandExpandedRegion(.trailing) {
Text("Trailing")
}
DynamicIslandExpandedRegion(.bottom) {
Text("Bottom")
** Button {
//Print here
print("Pressed")
} label: {
Text("Press Me")**
}.padding()
}
} compactLeading: {
I have tried testing in a new project, but I am still encountering the same problem with the button not firing any action.