Is there a way to shows detail texts and titles with a UIListContentConfiguration.subtitleCell() style on SwiftUI's List/Form?

I'm replacing Settings screen on my app with SwiftUI.

My App's Settings screen have a some fields that have a Toggle Switch, Title, and Subtitle.

but It is a hard to correctly reproduces UIListContentConfiguration.subtitleCell() layout in SwiftUI.

I'm trying by this code:

Toggle(isOn: $someFlag) {
    VStack(alignment: .leading) {
        Text("Title")
        Text("some descriptions about this toggle switch").font(.footnote)
    }
}

screenshots:

but it has some of issues:

  • wrong font size; subtitle of SwiftUI version is little a bit bigger than UIKit version
  • wrong padding; SwiftUI version has less padding than UIKit version, which makes hard to read (only little a bit, but I want to stick to its small differences)

It might be solvable by manually adds padding, specify font sizes etc, but I feel It is wrong way. It should be exists a beautiful way to reproduce it.

Is there a correct way to reproduce beautiful UIListContentConfiguration.subtitleCell() layout in SwiftUI?

Thanks!

I found that starting from iOS 16, simply place two Text to inside of Toggle's label then it magically treated as title and subtitle!

but on beta 1, spacing on these texts are smaller than line heights, so when title/subtitle has long text and wrapped, it seems weird.

so I just filed as FB10196516.

Is there a way to shows detail texts and titles with a UIListContentConfiguration.subtitleCell() style on SwiftUI's List/Form?
 
 
Q