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!