Subscriptions view

This commit is contained in:
Arkadiusz Fal
2021-06-12 00:49:42 +02:00
parent 4af395d788
commit 65e5f0f426
10 changed files with 78 additions and 60 deletions

View File

@@ -3,18 +3,22 @@ import SwiftUI
struct ContentView: View {
@StateObject var state = AppState()
@State var tabSelection: TabSelection = .popular
@State var tabSelection: TabSelection = .subscriptions
var body: some View {
NavigationView {
TabView(selection: $tabSelection) {
SubscriptionsView(state: state, tabSelection: $tabSelection)
.tabItem { Text("Subscriptions") }
.tag(TabSelection.subscriptions)
PopularVideosView(state: state, tabSelection: $tabSelection)
.tabItem { Text("Popular") }
.tag(TabSelection.popular)
if state.showingChannel {
ChannelView(state: state, tabSelection: $tabSelection)
.tabItem { Text("\(state.channel!) Channel") }
.tabItem { Text("\(state.channel) Channel") }
.tag(TabSelection.channel)
}

View File

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