Channel view

This commit is contained in:
Arkadiusz Fal
2021-06-11 23:11:59 +02:00
parent 4bc70f351d
commit 314c3b4968
13 changed files with 205 additions and 45 deletions

View File

@@ -1,14 +1,26 @@
import SwiftUI
struct ContentView: View {
@StateObject var state = AppState()
@State var tabSelection: TabSelection = .popular
var body: some View {
NavigationView {
TabView {
PopularVideosView()
TabView(selection: $tabSelection) {
PopularVideosView(state: state, tabSelection: $tabSelection)
.tabItem { Text("Popular") }
.tag(TabSelection.popular)
if state.showingChannel {
ChannelView(state: state, tabSelection: $tabSelection)
.tabItem { Text("\(state.channel!) Channel") }
.tag(TabSelection.channel)
}
SearchView()
.tabItem { Image(systemName: "magnifyingglass") }
.tag(TabSelection.search)
}
}
}

View File

@@ -0,0 +1,5 @@
import Foundation
enum TabSelection {
case popular, channel, search
}