SwiftUI 4 List customization

In SwiftUI 3, I used to be able to customize the spacing between sections using this:

    init() {
        UITableView.appearance().sectionFooterHeight = 0
        UITableView.appearance().sectionHeaderTopPadding = 0
        UITableView.appearance().sectionHeaderHeight = 8
    }

I need these sections because it's the only way to have swipe actions rendered with rounded corners (FB10233033). While this solution isn't ideal, it's the only way to use the native swipe actions and have this type of cells:

On SwiftUI 4, Lists are now using UICollectionView and the code in the custom initializer doesn't work anymore.

Hi William,

may you please share the code you used to customize the swipe options. I would really appreciate it since I've been looking for a customized swiping options from a couple of days to add them to my task-card like list.

It is a real pity. With the (understandable) departure of UITableView, an extremely large number of hacks that were in active use to use SwiftUI for productive apps break.

FYI: FB10225556 is my radar regarding this issue.

A list of swipeable cells feels a pretty common design pattern in 2022. I hope we’ll be able to have a way to implement this more easily in SwiftUI soon :)

SwiftUI 4 List customization
 
 
Q