2020-02-16 18:47:09 +00:00
|
|
|
//
|
2020-04-25 15:44:54 +01:00
|
|
|
// AppSkeleton.swift
|
2020-02-16 18:47:09 +00:00
|
|
|
// Music Tools
|
|
|
|
//
|
|
|
|
// Created by Andy Pack on 16/02/2020.
|
|
|
|
// Copyright © 2020 Sarsoo. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import SwiftUI
|
2020-02-22 13:28:15 +00:00
|
|
|
import SwiftUIRefresh
|
2020-02-18 01:44:30 +00:00
|
|
|
import Alamofire
|
2020-02-18 21:43:30 +00:00
|
|
|
import SwiftyJSON
|
2020-02-16 18:47:09 +00:00
|
|
|
|
2020-04-25 15:44:54 +01:00
|
|
|
struct AppSkeleton: View {
|
2020-02-19 23:00:23 +00:00
|
|
|
|
|
|
|
@EnvironmentObject var liveUser: LiveUser
|
|
|
|
|
2020-02-20 18:25:28 +00:00
|
|
|
@State private var selection = 0 // Tab view selection
|
2020-02-19 23:00:23 +00:00
|
|
|
|
2020-02-16 18:47:09 +00:00
|
|
|
var body: some View {
|
2020-04-25 15:44:54 +01:00
|
|
|
TabView {
|
2020-02-20 18:25:28 +00:00
|
|
|
|
2020-04-26 00:11:07 +01:00
|
|
|
PlaylistList()
|
|
|
|
.tabItem {
|
|
|
|
VStack {
|
|
|
|
Image(systemName: "music.note.list")
|
|
|
|
Text("Playlists")
|
2020-02-19 23:00:23 +00:00
|
|
|
}
|
2020-02-18 01:44:30 +00:00
|
|
|
}
|
2020-04-26 00:11:07 +01:00
|
|
|
.tag(0)
|
2020-02-20 18:25:28 +00:00
|
|
|
|
2020-04-26 00:11:07 +01:00
|
|
|
TagList()
|
|
|
|
.tabItem {
|
|
|
|
VStack {
|
|
|
|
Image(systemName: "tag")
|
|
|
|
Text("Tags")
|
2020-02-20 18:25:28 +00:00
|
|
|
}
|
2020-02-16 18:47:09 +00:00
|
|
|
}
|
2020-04-26 00:11:07 +01:00
|
|
|
.tag(1)
|
|
|
|
|
|
|
|
SettingsList()
|
|
|
|
.tabItem {
|
|
|
|
VStack {
|
|
|
|
Image(systemName: "slider.horizontal.3")
|
|
|
|
Text("Settings")
|
2020-02-20 18:25:28 +00:00
|
|
|
}
|
2020-02-18 01:44:30 +00:00
|
|
|
}
|
2020-04-26 00:11:07 +01:00
|
|
|
.tag(2)
|
2020-02-20 18:25:28 +00:00
|
|
|
|
2020-02-18 01:44:30 +00:00
|
|
|
}.onAppear {
|
2020-02-22 13:28:15 +00:00
|
|
|
self.fetchAll()
|
2020-02-16 18:47:09 +00:00
|
|
|
}
|
|
|
|
}
|
2020-02-18 01:44:30 +00:00
|
|
|
|
2020-02-22 13:28:15 +00:00
|
|
|
private func fetchAll() {
|
2020-03-06 23:36:51 +00:00
|
|
|
self.liveUser.refreshPlaylists()
|
|
|
|
self.liveUser.refreshTags()
|
2020-02-18 01:44:30 +00:00
|
|
|
}
|
2020-02-16 18:47:09 +00:00
|
|
|
}
|
|
|
|
|
2020-02-17 02:21:49 +00:00
|
|
|
struct RootView_Previews: PreviewProvider {
|
2020-02-16 18:47:09 +00:00
|
|
|
static var previews: some View {
|
2020-04-25 15:44:54 +01:00
|
|
|
AppSkeleton()
|
2020-02-16 18:47:09 +00:00
|
|
|
}
|
|
|
|
}
|