diff --git a/DHBW-Service.xcodeproj/project.pbxproj b/DHBW-Service.xcodeproj/project.pbxproj index be72445..4766aef 100644 --- a/DHBW-Service.xcodeproj/project.pbxproj +++ b/DHBW-Service.xcodeproj/project.pbxproj @@ -18,6 +18,7 @@ CDCD721A25912E1200FBF2F5 /* HomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDCD721925912E1200FBF2F5 /* HomeView.swift */; }; CDCD72242591316500FBF2F5 /* LocalSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDCD72232591316500FBF2F5 /* LocalSettings.swift */; }; CDCD7230259135C500FBF2F5 /* FirstOpeningSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDCD722F259135C500FBF2F5 /* FirstOpeningSettings.swift */; }; + CDD39B4B259A64150078D05F /* SettingsMain.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDD39B4A259A64150078D05F /* SettingsMain.swift */; }; CDDCF47B2591FE550027CDC5 /* UtilityFunctions.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDDCF47A2591FE550027CDC5 /* UtilityFunctions.swift */; }; CDDCF4842592028A0027CDC5 /* Localizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDDCF4832592028A0027CDC5 /* Localizer.swift */; }; CDDCF493259203390027CDC5 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = CDDCF495259203390027CDC5 /* Localizable.strings */; }; @@ -59,6 +60,7 @@ CDCD721925912E1200FBF2F5 /* HomeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeView.swift; sourceTree = ""; }; CDCD72232591316500FBF2F5 /* LocalSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalSettings.swift; sourceTree = ""; }; CDCD722F259135C500FBF2F5 /* FirstOpeningSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirstOpeningSettings.swift; sourceTree = ""; }; + CDD39B4A259A64150078D05F /* SettingsMain.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsMain.swift; sourceTree = ""; }; CDDCF47A2591FE550027CDC5 /* UtilityFunctions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UtilityFunctions.swift; sourceTree = ""; }; CDDCF4832592028A0027CDC5 /* Localizer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Localizer.swift; sourceTree = ""; }; CDDCF494259203390027CDC5 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; @@ -193,6 +195,7 @@ isa = PBXGroup; children = ( CDCD721925912E1200FBF2F5 /* HomeView.swift */, + CDD39B4A259A64150078D05F /* SettingsMain.swift */, ); path = Tabs; sourceTree = ""; @@ -370,6 +373,7 @@ CDCD72242591316500FBF2F5 /* LocalSettings.swift in Sources */, CD9FAB8D258EC60600D6D0C5 /* DHBW_Service.xcdatamodeld in Sources */, CDCD721A25912E1200FBF2F5 /* HomeView.swift in Sources */, + CDD39B4B259A64150078D05F /* SettingsMain.swift in Sources */, CDDCF47B2591FE550027CDC5 /* UtilityFunctions.swift in Sources */, CD9FAB81258EC60200D6D0C5 /* DHBW_ServiceApp.swift in Sources */, ); @@ -551,7 +555,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_ASSET_PATHS = "\"DHBW-Service/Preview Content\""; - DEVELOPMENT_TEAM = G3TRS8UHWN; + DEVELOPMENT_TEAM = HS7KNT4MZ2; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = "DHBW-Service/Supporting Files/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 14.0; @@ -573,7 +577,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_ASSET_PATHS = "\"DHBW-Service/Preview Content\""; - DEVELOPMENT_TEAM = G3TRS8UHWN; + DEVELOPMENT_TEAM = HS7KNT4MZ2; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = "DHBW-Service/Supporting Files/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 14.0; diff --git a/DHBW-Service/Views/ContentView.swift b/DHBW-Service/Views/ContentView.swift index 53f80c5..223c9e6 100644 --- a/DHBW-Service/Views/ContentView.swift +++ b/DHBW-Service/Views/ContentView.swift @@ -26,7 +26,7 @@ struct ContentView: View { } } .tag(0) - HomeView() + SettingsMain() .tabItem { VStack { Image(systemName: "gear") diff --git a/DHBW-Service/Views/Other/FirstOpeningSettings.swift b/DHBW-Service/Views/Other/FirstOpeningSettings.swift index c660b56..abb6157 100644 --- a/DHBW-Service/Views/Other/FirstOpeningSettings.swift +++ b/DHBW-Service/Views/Other/FirstOpeningSettings.swift @@ -107,6 +107,13 @@ struct FirstOpeningSettings_Previews: PreviewProvider { static var previews: some View { FirstOpeningSettings() .preferredColorScheme(.dark) - .environmentObject(LocalSettings()) + .environmentObject(getFirstOpening()) + .environment(\.managedObjectContext, PersistenceController.preview.container.viewContext) + } + + static func getFirstOpening() -> LocalSettings { + let settings = LocalSettings(); + settings.isFirstOpening = false; + return settings } } diff --git a/DHBW-Service/Views/Tabs/HomeView.swift b/DHBW-Service/Views/Tabs/HomeView.swift index 58c6a77..8bf2efa 100644 --- a/DHBW-Service/Views/Tabs/HomeView.swift +++ b/DHBW-Service/Views/Tabs/HomeView.swift @@ -51,6 +51,13 @@ struct HomeView_Previews: PreviewProvider { static var previews: some View { HomeView() .preferredColorScheme(.dark) - .environmentObject(LocalSettings()) + .environmentObject(getFirstOpening()) + .environment(\.managedObjectContext, PersistenceController.preview.container.viewContext) + } + + static func getFirstOpening() -> LocalSettings { + let settings = LocalSettings(); + settings.isFirstOpening = false; + return settings } } diff --git a/DHBW-Service/Views/Tabs/SettingsMain.swift b/DHBW-Service/Views/Tabs/SettingsMain.swift new file mode 100644 index 0000000..d102bf8 --- /dev/null +++ b/DHBW-Service/Views/Tabs/SettingsMain.swift @@ -0,0 +1,29 @@ +// +// SettingsMain.swift +// DHBW-Service +// +// Created by Patrick Müller on 28.12.20. +// + +import SwiftUI + +struct SettingsMain: View { + var body: some View { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + } +} + +struct SettingsMain_Previews: PreviewProvider { + static var previews: some View { + SettingsMain() + .preferredColorScheme(.dark) + .environmentObject(getFirstOpening()) + .environment(\.managedObjectContext, PersistenceController.preview.container.viewContext) + } + + static func getFirstOpening() -> LocalSettings { + let settings = LocalSettings(); + settings.isFirstOpening = false; + return settings + } +}