yattee/Apple TV/PopularVideosView.swift

22 lines
494 B
Swift
Raw Normal View History

2021-06-11 12:36:26 +00:00
import SwiftUI
struct PopularVideosView: View {
2021-06-11 21:11:59 +00:00
@ObservedObject private var provider = PopularVideosProvider()
@ObservedObject var state: AppState
2021-06-11 21:40:35 +00:00
2021-06-11 21:11:59 +00:00
@Binding var tabSelection: TabSelection
2021-06-11 12:36:26 +00:00
var body: some View {
2021-06-11 21:40:35 +00:00
VideosView(state: state, tabSelection: $tabSelection, videos: videos)
.task {
async {
provider.load()
2021-06-11 12:36:26 +00:00
}
}
}
2021-06-11 21:11:59 +00:00
2021-06-11 21:40:35 +00:00
var videos: [Video] {
return provider.videos
2021-06-11 12:36:26 +00:00
}
}