I'd really like to be able to show List row swipe actions with text and an image, like in Mail.app:
In my app, using the .swipeActions modifier on a list row, I have been unable to display both text and an image. It just displays the image.
Here is my code:
.swipeActions(edge: .leading, allowsFullSwipe: true) {
Button {
Task {
await albumProvider.treatGridAsQueue(album: album)
}
} label: {
Label("Play", systemImage: "play.fill")
}
Button {
AlbumContextHandler.shared.handleTag(albumObject: album, session: nil, presentedSheet: $albumProvider.sheetToPresent)
} label: {
Label("Tag", systemImage: "tag.fill") {
}
}
I have also tried various initializers on Button
, including init(_:systemImage:action:), but none of them have worked.
The strange thing is that very occasionally just the top row of a List will display the title and label the first time the swipe actions are displayed. Showing them a second time will just show the icons, as in my screenshot.
I've also played around with .buttonStyles but haven't found those to make a difference.
Any ideas?