yattee/Apple TV/CoverSectionRowView.swift

20 lines
416 B
Swift
Raw Normal View History

2021-07-07 22:39:18 +00:00
import SwiftUI
2021-07-08 15:14:54 +00:00
struct CoverSectionRowView<Content: View>: View {
let label: String?
2021-07-07 22:39:18 +00:00
let controlView: Content
2021-07-08 15:14:54 +00:00
init(_ label: String? = nil, @ViewBuilder controlView: @escaping () -> Content) {
2021-07-07 22:39:18 +00:00
self.label = label
self.controlView = controlView()
}
var body: some View {
HStack {
2021-07-08 15:14:54 +00:00
Text(label ?? "")
2021-07-07 22:39:18 +00:00
Spacer()
controlView
}
}
}