diff LazyBear/ContentView.swift @ 296:b481783c32c0

Start version 4
author Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
date Sun, 21 Mar 2021 19:56:24 +0100
parents 22eba376075e
children 46dfb60e0874
line wrap: on
line diff
--- a/LazyBear/ContentView.swift	Sat Mar 20 19:18:25 2021 +0100
+++ b/LazyBear/ContentView.swift	Sun Mar 21 19:56:24 2021 +0100
@@ -2,79 +2,19 @@
 //  ContentView.swift
 //  LazyBear
 //
-//  Created by Dennis Concepción Martín on 17/2/21.
+//  Created by Dennis Concepción Martín on 21/3/21.
 //
 
 import SwiftUI
 
 struct ContentView: View {
-    @EnvironmentObject var hudManager: HudManager
-    @EnvironmentObject var deviceSize: DeviceSize
-    @EnvironmentObject var hapticsManager: HapticsManager
-    
-    // Fetch user appearence settings
-    @FetchRequest(entity: UserSettings.entity(), sortDescriptors: [NSSortDescriptor(keyPath: \UserSettings.changedAt, ascending: false)])
-    var userSettings: FetchedResults<UserSettings>
-    
     var body: some View {
-        GeometryReader { geo in
-            ZStack(alignment: .top) {
-                TabView {
-                    // First view
-                    Watchlist()
-                        .tabItem {
-                            Label("Watchlist", systemImage: "list.dash")
-                        }
-                    
-                    // First view
-                    Search()
-                        .tabItem {
-                            Label("Search", systemImage: "magnifyingglass")
-                        }
-                    
-                    // First view
-                    Settings()
-                        .tabItem {
-                            Label("Settings", systemImage: "gear")
-                        }
-                }
-                
-                // Show HUDs
-                // Notification
-                Notification(text: "Company saved", image: "checkmark.circle")
-                    .offset(y: hudManager.showNotification ? 0 : -100)
-                    .animation(.easeInOut)
-                
-                // Action sheet
-                ZStack(alignment: .bottom) {
-                    Color(.black)
-                        .edgesIgnoringSafeArea(.all)
-                        .opacity(hudManager.showAction ? 0.2: 0)
-                        .animation(.easeInOut)
-                        .onTapGesture { hudManager.showAction = false }
-                    
-                    ActionView()
-                        .offset(y: hudManager.showAction ? 0 : 250)
-                        .animation(.easeInOut)
-                        .padding()
-                }
-            }
-            .accentColor(Color("\(userSettings.first?.theme?.lowercased() ?? "default")Accent"))
-            // If this value is not optional it will cause a crash
-            .onAppear {
-                // Assign device screen size to the class
-                self.deviceSize.width = geo.size.width
-                self.deviceSize.height = geo.size.height
-                hapticsManager.prepareHaptics()
-            }
-        }
+        Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
     }
 }
 
-
 struct ContentView_Previews: PreviewProvider {
     static var previews: some View {
         ContentView()
-            .environmentObject(HudManager())
     }
 }