From a1e3f009b3ab91f140f63a330994e9079a2266d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20F=C3=B6rtsch?= Date: Wed, 18 Feb 2026 10:50:25 +0100 Subject: [PATCH] snapshot current state before gitea sync --- StudyStructure.xcodeproj/project.pbxproj | 376 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../xcschemes/xcschememanagement.plist | 14 + StudyStructure/CourseCatalogView.swift | 38 +- StudyStructure/CourseDetailsView.swift | 32 ++ StudyStructure/Structs.swift | 29 +- StudyStructure/courses.json | 2 +- 8 files changed, 482 insertions(+), 24 deletions(-) create mode 100644 StudyStructure.xcodeproj/project.pbxproj create mode 100644 StudyStructure.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 StudyStructure.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 StudyStructure.xcodeproj/xcuserdata/felixfoertsch.xcuserdatad/xcschemes/xcschememanagement.plist create mode 100644 StudyStructure/CourseDetailsView.swift diff --git a/StudyStructure.xcodeproj/project.pbxproj b/StudyStructure.xcodeproj/project.pbxproj new file mode 100644 index 0000000..e6b44de --- /dev/null +++ b/StudyStructure.xcodeproj/project.pbxproj @@ -0,0 +1,376 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 55; + objects = { + +/* Begin PBXBuildFile section */ + 3F7D617526B6CA27005D6CA9 /* CourseDetailsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F7D617426B6CA27005D6CA9 /* CourseDetailsView.swift */; }; + 3FAD6B8126B677A9000B4BD0 /* MainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FAD6B8026B677A9000B4BD0 /* MainView.swift */; }; + 3FAD6B8326B677DC000B4BD0 /* CourseCatalogView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FAD6B8226B677DC000B4BD0 /* CourseCatalogView.swift */; }; + 3FAD6B8526B677FB000B4BD0 /* CurriculumView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FAD6B8426B677FB000B4BD0 /* CurriculumView.swift */; }; + 3FAD6B8726B67F6F000B4BD0 /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FAD6B8626B67F6F000B4BD0 /* SettingsView.swift */; }; + 3FAD6B8926B68171000B4BD0 /* Structs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FAD6B8826B68171000B4BD0 /* Structs.swift */; }; + 3FE060C926B34EB5004E2F3C /* StudyStructureApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FE060C826B34EB5004E2F3C /* StudyStructureApp.swift */; }; + 3FE060CD26B34EB6004E2F3C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3FE060CC26B34EB6004E2F3C /* Assets.xcassets */; }; + 3FE060D026B34EB6004E2F3C /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3FE060CF26B34EB6004E2F3C /* Preview Assets.xcassets */; }; + 3FE060D726B34F0D004E2F3C /* curriculums.json in Resources */ = {isa = PBXBuildFile; fileRef = 3FE060D626B34F0D004E2F3C /* curriculums.json */; }; + 3FE060D926B354C2004E2F3C /* courses.json in Resources */ = {isa = PBXBuildFile; fileRef = 3FE060D826B354C2004E2F3C /* courses.json */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 3F7D617426B6CA27005D6CA9 /* CourseDetailsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseDetailsView.swift; sourceTree = ""; }; + 3FAD6B8026B677A9000B4BD0 /* MainView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainView.swift; sourceTree = ""; }; + 3FAD6B8226B677DC000B4BD0 /* CourseCatalogView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseCatalogView.swift; sourceTree = ""; }; + 3FAD6B8426B677FB000B4BD0 /* CurriculumView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CurriculumView.swift; sourceTree = ""; }; + 3FAD6B8626B67F6F000B4BD0 /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = ""; }; + 3FAD6B8826B68171000B4BD0 /* Structs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Structs.swift; sourceTree = ""; }; + 3FE060C526B34EB5004E2F3C /* StudyStructure.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = StudyStructure.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 3FE060C826B34EB5004E2F3C /* StudyStructureApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StudyStructureApp.swift; sourceTree = ""; }; + 3FE060CC26B34EB6004E2F3C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 3FE060CF26B34EB6004E2F3C /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 3FE060D626B34F0D004E2F3C /* curriculums.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = curriculums.json; sourceTree = ""; }; + 3FE060D826B354C2004E2F3C /* courses.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = courses.json; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 3FE060C226B34EB5004E2F3C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 3FE060BC26B34EB5004E2F3C = { + isa = PBXGroup; + children = ( + 3FE060C726B34EB5004E2F3C /* StudyStructure */, + 3FE060C626B34EB5004E2F3C /* Products */, + ); + sourceTree = ""; + }; + 3FE060C626B34EB5004E2F3C /* Products */ = { + isa = PBXGroup; + children = ( + 3FE060C526B34EB5004E2F3C /* StudyStructure.app */, + ); + name = Products; + sourceTree = ""; + }; + 3FE060C726B34EB5004E2F3C /* StudyStructure */ = { + isa = PBXGroup; + children = ( + 3FE060CC26B34EB6004E2F3C /* Assets.xcassets */, + 3FE060CE26B34EB6004E2F3C /* Preview Content */, + 3FE060D626B34F0D004E2F3C /* curriculums.json */, + 3FE060D826B354C2004E2F3C /* courses.json */, + 3FE060C826B34EB5004E2F3C /* StudyStructureApp.swift */, + 3FAD6B8026B677A9000B4BD0 /* MainView.swift */, + 3FAD6B8426B677FB000B4BD0 /* CurriculumView.swift */, + 3FAD6B8226B677DC000B4BD0 /* CourseCatalogView.swift */, + 3F7D617426B6CA27005D6CA9 /* CourseDetailsView.swift */, + 3FAD6B8626B67F6F000B4BD0 /* SettingsView.swift */, + 3FAD6B8826B68171000B4BD0 /* Structs.swift */, + ); + path = StudyStructure; + sourceTree = ""; + }; + 3FE060CE26B34EB6004E2F3C /* Preview Content */ = { + isa = PBXGroup; + children = ( + 3FE060CF26B34EB6004E2F3C /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 3FE060C426B34EB5004E2F3C /* StudyStructure */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3FE060D326B34EB6004E2F3C /* Build configuration list for PBXNativeTarget "StudyStructure" */; + buildPhases = ( + 3FE060C126B34EB5004E2F3C /* Sources */, + 3FE060C226B34EB5004E2F3C /* Frameworks */, + 3FE060C326B34EB5004E2F3C /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = StudyStructure; + productName = StudyStructure; + productReference = 3FE060C526B34EB5004E2F3C /* StudyStructure.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 3FE060BD26B34EB5004E2F3C /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1300; + LastUpgradeCheck = 1300; + TargetAttributes = { + 3FE060C426B34EB5004E2F3C = { + CreatedOnToolsVersion = 13.0; + }; + }; + }; + buildConfigurationList = 3FE060C026B34EB5004E2F3C /* Build configuration list for PBXProject "StudyStructure" */; + compatibilityVersion = "Xcode 13.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 3FE060BC26B34EB5004E2F3C; + productRefGroup = 3FE060C626B34EB5004E2F3C /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 3FE060C426B34EB5004E2F3C /* StudyStructure */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 3FE060C326B34EB5004E2F3C /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3FE060D026B34EB6004E2F3C /* Preview Assets.xcassets in Resources */, + 3FE060CD26B34EB6004E2F3C /* Assets.xcassets in Resources */, + 3FE060D726B34F0D004E2F3C /* curriculums.json in Resources */, + 3FE060D926B354C2004E2F3C /* courses.json in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 3FE060C126B34EB5004E2F3C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3FAD6B8926B68171000B4BD0 /* Structs.swift in Sources */, + 3FAD6B8726B67F6F000B4BD0 /* SettingsView.swift in Sources */, + 3FAD6B8326B677DC000B4BD0 /* CourseCatalogView.swift in Sources */, + 3FAD6B8126B677A9000B4BD0 /* MainView.swift in Sources */, + 3F7D617526B6CA27005D6CA9 /* CourseDetailsView.swift in Sources */, + 3FAD6B8526B677FB000B4BD0 /* CurriculumView.swift in Sources */, + 3FE060C926B34EB5004E2F3C /* StudyStructureApp.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 3FE060D126B34EB6004E2F3C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 3FE060D226B34EB6004E2F3C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 3FE060D426B34EB6004E2F3C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"StudyStructure/Preview Content\""; + DEVELOPMENT_TEAM = NG5W75WE8U; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = de.felixfoertsch.StudyStructure; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 3FE060D526B34EB6004E2F3C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"StudyStructure/Preview Content\""; + DEVELOPMENT_TEAM = NG5W75WE8U; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = de.felixfoertsch.StudyStructure; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 3FE060C026B34EB5004E2F3C /* Build configuration list for PBXProject "StudyStructure" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3FE060D126B34EB6004E2F3C /* Debug */, + 3FE060D226B34EB6004E2F3C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 3FE060D326B34EB6004E2F3C /* Build configuration list for PBXNativeTarget "StudyStructure" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3FE060D426B34EB6004E2F3C /* Debug */, + 3FE060D526B34EB6004E2F3C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 3FE060BD26B34EB5004E2F3C /* Project object */; +} diff --git a/StudyStructure.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/StudyStructure.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/StudyStructure.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/StudyStructure.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/StudyStructure.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/StudyStructure.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/StudyStructure.xcodeproj/xcuserdata/felixfoertsch.xcuserdatad/xcschemes/xcschememanagement.plist b/StudyStructure.xcodeproj/xcuserdata/felixfoertsch.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..571c22c --- /dev/null +++ b/StudyStructure.xcodeproj/xcuserdata/felixfoertsch.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + StudyStructure.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/StudyStructure/CourseCatalogView.swift b/StudyStructure/CourseCatalogView.swift index 3b17edd..9099e23 100644 --- a/StudyStructure/CourseCatalogView.swift +++ b/StudyStructure/CourseCatalogView.swift @@ -8,25 +8,43 @@ import SwiftUI struct CourseCatalogView: View { - func parse() -> [Course] { + + var courses: [Course] { let url = Bundle.main.url(forResource: "courses", withExtension: "json")! let data = try! Data(contentsOf: url) let decoder = JSONDecoder() - let products = try? decoder.decode([Course].self, from: data) - return products! + var courses = try? decoder.decode([Course].self, from: data) + + courses?.sort(by: { $0.name < $1.name }) + return courses! } + @State var searchText = "" + + var searchResults: [Course] { + if searchText.isEmpty { + return courses + } else { + return courses.filter { $0.name.contains(searchText) } + } + } var body: some View { NavigationView { - List{ - ForEach(parse(), id: \.self) { item in - VStack(alignment: .leading, spacing: 0){ - Text("name:\(item.name)") - Text("\(item.description)") + List { + ForEach(searchResults, id: \.self) { item in + + NavigationLink(destination: CourseDetailsView(item)) { + VStack(alignment: .leading) { + Text(item.name) + Text(item.type) + .font(.subheadline) + .foregroundColor(Color.gray) + } } } } + .searchable(text: $searchText) .navigationBarTitle("Courses") } } @@ -34,6 +52,8 @@ struct CourseCatalogView: View { struct CourseCatalogView_Previews: PreviewProvider { static var previews: some View { - CourseCatalogView().preferredColorScheme(.dark) + Group { + CourseCatalogView().preferredColorScheme(.dark) + } } } diff --git a/StudyStructure/CourseDetailsView.swift b/StudyStructure/CourseDetailsView.swift new file mode 100644 index 0000000..7d6d4aa --- /dev/null +++ b/StudyStructure/CourseDetailsView.swift @@ -0,0 +1,32 @@ +// +// CourseDetailsView.swift +// CourseDetailsView +// +// Created by Felix Förtsch on 01.08.21. +// + +import SwiftUI + +struct CourseDetailsView: View { + + init(_ course: Course) { + self.course = course + } + + let course: Course + + var body: some View { + VStack { + Text(course.id) + Text(course.name) + Text(course.description) + } + + } +} + +//struct CourseDetailsView_Previews: PreviewProvider { +// static var previews: some View { +// CourseDetailsView() +// } +//} diff --git a/StudyStructure/Structs.swift b/StudyStructure/Structs.swift index 74df9ee..c67f2ab 100644 --- a/StudyStructure/Structs.swift +++ b/StudyStructure/Structs.swift @@ -15,21 +15,22 @@ struct Course: Codable, Hashable { var cp: Int } -struct SlotTypes: Codable { - var cp: Int - var amount: Int - var type: String -} - -struct Curriculum : Codable { - let id: Int - let name: String - let cp: Int - let publishedDate: Date - var slotTypes: [SlotTypes] -} - struct School: Codable { var name: String var curriculums: [Curriculum] + + struct Curriculum : Codable { + let id: Int + let name: String + let cp: Int + let publishedDate: Date + var slotTypes: [SlotTypes] + + struct SlotTypes: Codable { + var cp: Int + var amount: Int + var type: String + } + } } + diff --git a/StudyStructure/courses.json b/StudyStructure/courses.json index fa45f75..5cc5e95 100644 --- a/StudyStructure/courses.json +++ b/StudyStructure/courses.json @@ -394,7 +394,7 @@ { "id": "10-202-2225", "name": "Zeichnen von Graphen", - "type": "", + "type": "Vertiefungsmodul", "cp": 10, "description": "", "duration": 1