// // ContentView.swift // spacex // // Created by Charlie Kingsland on 20/01/2021. // import SwiftUI import SDWebImage import HalfModal import Foundation //import views struct ContentView: View { // @State var launches: [Launch] = [] // @State var rockets: [Rocket] = [] // // @State private var showingAlert = false // @State private var show_modal: Bool = false // @State private var mName: String = "" // @State private var mDate: String = "" // @State private var rID: String = "" // @State private var mImg: String = "" // @State private var mDesc: String = "" // @State private var mYT: String = "" // @State private var ytBool: Bool = false // // @State private var rName: String = "" // // // // @State private var showingHalfModal: Bool = false // @State private var showingHalfModal2: Bool = false // // // var rocketNames = ["5e9d0d95eda69955f709d1eb": "Falcon 1", "5e9d0d95eda69973a809d1ec": "Falcon 9", "5e9d0d95eda69974db09d1ed": "Falcon Heavy", "5e9d0d96eda699382d09d1ee": "Starship"] // // var rocketIcons = ["Falcon 1": "spx", "Falcon 9": "f9", "Falcon Heavy": "fh", "Starship": "spx"] init() { UITableView.appearance().separatorStyle = .none UITableViewCell.appearance().backgroundColor = .clear UITableView.appearance().backgroundColor = .clear } var body: some View { // Spacer() // .frame(height: 100) TabView{ launchView() .tabItem { Image(systemName: "flame") Text("Launches") } // Text("rockets") rocketView() .tabItem { Image(systemName: "paperplane") Text("Rockets") } Text("launchpads") .tabItem { Image(systemName: "arrow.up") Text("Launchpads") } Text("landpads") .tabItem { Image(systemName: "arrow.down") Text("Landpads") } Text("crew") .tabItem { Image(systemName: "person.3") Text("Crew") } Text("roadster") .tabItem { Image(systemName: "car") Text("Roadster") } // Text("about") aboutView() .tabItem { Image(systemName: "questionmark") Text("About app") } } } // var rocketListButtons: some View { // // } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } } extension Date { func getFormattedDate(format: String) -> String { let dateformat = DateFormatter() dateformat.dateFormat = format return dateformat.string(from: self) } } extension Bundle { public var appVersionShort: String? { if let result = infoDictionary?["CFBundleShortVersionString"] as? String { return result } else { return "⚠️" } } public var appVersionLong: String? { if let result = infoDictionary?["CFBundleVersion"] as? String { return result } else { return "⚠️" } } public var appName: String? { if let result = infoDictionary?["CFBundleName"] as? String { return result } else { return "⚠️" } } }