Post not yet marked as solved
Click to stop watching this thread.
You have stopped watching this post. Click to start watching again.
Post marked as unsolved with 1 replies, 0 views
Replied In
Weird UI layout in SwiftUI .swipeActions
Works for me
I have a simplified example tried on macOS Ventura which seems to working ok.
Please check
Check your TableRow code, try to replace with TableRow with Text and see if it works
My Code
struct Message: Identifiable {
var text: String
var id: String {
text
}
}
struct ContentView: View {
let messages = [Message(text: "aaa"),
Message(text: "bbb"),
Message(text: "ccc")]
var body: some View {
VStack {
List {
Section {
ForEach(messages) { message in
Text(message.text)
.swipeActions {
Button(role: .destructive) {
// data.delete(datum)
} label: {
Label("Delete", systemImage: "trash")
}
}
}
}
}
}
}
}