yattee/Apple TV/PopularVideosView.swift

28 lines
660 B
Swift
Raw Normal View History

2021-06-11 12:36:26 +00:00
import Foundation
import SwiftUI
struct PopularVideosView: View {
@ObservedObject private var popular = PopluarVideosProvider()
var body: some View {
Group {
List {
ForEach(popular.videos) { video in
VideoThumbnailView(video: video)
.listRowInsets(listRowInsets)
}
}
.listStyle(GroupedListStyle())
}
.task {
async {
popular.load()
}
}
}
var listRowInsets: EdgeInsets {
EdgeInsets(top: .zero, leading: .zero, bottom: .zero, trailing: 30)
}
}