commit 5102f7a2da168cdb74bf1e088fae140ab75df08c Author: ismail.taha_janan Date: Tue Jun 13 20:40:57 2023 +0200 MVVM workin i guess diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..b059d89 Binary files /dev/null and b/.DS_Store differ diff --git a/CalculMoy/.DS_Store b/CalculMoy/.DS_Store new file mode 100644 index 0000000..8b4cd59 Binary files /dev/null and b/CalculMoy/.DS_Store differ diff --git a/CalculMoy/CalculMoy.xcodeproj/project.pbxproj b/CalculMoy/CalculMoy.xcodeproj/project.pbxproj new file mode 100644 index 0000000..50dda7a --- /dev/null +++ b/CalculMoy/CalculMoy.xcodeproj/project.pbxproj @@ -0,0 +1,674 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 56; + objects = { + +/* Begin PBXBuildFile section */ + EC14918A2A20D64500B2D47A /* Block.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC1491892A20D64500B2D47A /* Block.swift */; }; + EC14918D2A20DF2900B2D47A /* MySlider.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC14918C2A20DF2900B2D47A /* MySlider.swift */; }; + EC14918F2A29F05A00B2D47A /* UsList.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC14918E2A29F05A00B2D47A /* UsList.swift */; }; + EC1491942A35B7CA00B2D47A /* Module.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC1491932A35B7CA00B2D47A /* Module.swift */; }; + EC1491962A35B91D00B2D47A /* UE.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC1491952A35B91D00B2D47A /* UE.swift */; }; + EC1491982A35BD3400B2D47A /* Stub.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC1491972A35BD3400B2D47A /* Stub.swift */; }; + EC14919A2A35D15000B2D47A /* Manager.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC1491992A35D15000B2D47A /* Manager.swift */; }; + EC14919D2A35F60000B2D47A /* ModuleVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC14919C2A35F60000B2D47A /* ModuleVM.swift */; }; + EC14919F2A36022C00B2D47A /* UeVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC14919E2A36022C00B2D47A /* UeVM.swift */; }; + EC1491A22A361B7600B2D47A /* ManagerVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC1491A12A361B7600B2D47A /* ManagerVM.swift */; }; + EC243AA42A1FA0440017C10A /* CalculMoyApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC243AA32A1FA0440017C10A /* CalculMoyApp.swift */; }; + EC243AA62A1FA0440017C10A /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC243AA52A1FA0440017C10A /* ContentView.swift */; }; + EC243AA82A1FA0460017C10A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EC243AA72A1FA0460017C10A /* Assets.xcassets */; }; + EC243AAB2A1FA0460017C10A /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EC243AAA2A1FA0460017C10A /* Preview Assets.xcassets */; }; + EC243AB52A1FA0460017C10A /* CalculMoyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC243AB42A1FA0460017C10A /* CalculMoyTests.swift */; }; + EC243ABF2A1FA0460017C10A /* CalculMoyUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC243ABE2A1FA0460017C10A /* CalculMoyUITests.swift */; }; + EC243AC12A1FA0460017C10A /* CalculMoyUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC243AC02A1FA0460017C10A /* CalculMoyUITestsLaunchTests.swift */; }; + EC97FE492A378E59007AEC0A /* UEView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC97FE482A378E59007AEC0A /* UEView.swift */; }; + EC97FE4B2A3798B7007AEC0A /* ModuleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC97FE4A2A3798B7007AEC0A /* ModuleView.swift */; }; + EC97FE4D2A37A9F6007AEC0A /* UISliderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC97FE4C2A37A9F6007AEC0A /* UISliderView.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + EC243AB12A1FA0460017C10A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = EC243A982A1FA0440017C10A /* Project object */; + proxyType = 1; + remoteGlobalIDString = EC243A9F2A1FA0440017C10A; + remoteInfo = CalculMoy; + }; + EC243ABB2A1FA0460017C10A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = EC243A982A1FA0440017C10A /* Project object */; + proxyType = 1; + remoteGlobalIDString = EC243A9F2A1FA0440017C10A; + remoteInfo = CalculMoy; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + EC1491892A20D64500B2D47A /* Block.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Block.swift; sourceTree = ""; }; + EC14918C2A20DF2900B2D47A /* MySlider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MySlider.swift; sourceTree = ""; }; + EC14918E2A29F05A00B2D47A /* UsList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UsList.swift; sourceTree = ""; }; + EC1491932A35B7CA00B2D47A /* Module.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Module.swift; sourceTree = ""; }; + EC1491952A35B91D00B2D47A /* UE.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UE.swift; sourceTree = ""; }; + EC1491972A35BD3400B2D47A /* Stub.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Stub.swift; sourceTree = ""; }; + EC1491992A35D15000B2D47A /* Manager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Manager.swift; sourceTree = ""; }; + EC14919C2A35F60000B2D47A /* ModuleVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModuleVM.swift; sourceTree = ""; }; + EC14919E2A36022C00B2D47A /* UeVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UeVM.swift; sourceTree = ""; }; + EC1491A12A361B7600B2D47A /* ManagerVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ManagerVM.swift; sourceTree = ""; }; + EC243AA02A1FA0440017C10A /* CalculMoy.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CalculMoy.app; sourceTree = BUILT_PRODUCTS_DIR; }; + EC243AA32A1FA0440017C10A /* CalculMoyApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalculMoyApp.swift; sourceTree = ""; }; + EC243AA52A1FA0440017C10A /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + EC243AA72A1FA0460017C10A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + EC243AAA2A1FA0460017C10A /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + EC243AB02A1FA0460017C10A /* CalculMoyTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CalculMoyTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + EC243AB42A1FA0460017C10A /* CalculMoyTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalculMoyTests.swift; sourceTree = ""; }; + EC243ABA2A1FA0460017C10A /* CalculMoyUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CalculMoyUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + EC243ABE2A1FA0460017C10A /* CalculMoyUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalculMoyUITests.swift; sourceTree = ""; }; + EC243AC02A1FA0460017C10A /* CalculMoyUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalculMoyUITestsLaunchTests.swift; sourceTree = ""; }; + EC97FE482A378E59007AEC0A /* UEView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UEView.swift; sourceTree = ""; }; + EC97FE4A2A3798B7007AEC0A /* ModuleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModuleView.swift; sourceTree = ""; }; + EC97FE4C2A37A9F6007AEC0A /* UISliderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UISliderView.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + EC243A9D2A1FA0440017C10A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + EC243AAD2A1FA0460017C10A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + EC243AB72A1FA0460017C10A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + EC14918B2A20DEEB00B2D47A /* Utile */ = { + isa = PBXGroup; + children = ( + EC14918C2A20DF2900B2D47A /* MySlider.swift */, + ); + path = Utile; + sourceTree = ""; + }; + EC1491902A35B70500B2D47A /* Model */ = { + isa = PBXGroup; + children = ( + EC1491932A35B7CA00B2D47A /* Module.swift */, + EC1491952A35B91D00B2D47A /* UE.swift */, + EC1491972A35BD3400B2D47A /* Stub.swift */, + EC1491992A35D15000B2D47A /* Manager.swift */, + ); + path = Model; + sourceTree = ""; + }; + EC14919B2A35E97F00B2D47A /* ViewModel */ = { + isa = PBXGroup; + children = ( + EC14919C2A35F60000B2D47A /* ModuleVM.swift */, + EC14919E2A36022C00B2D47A /* UeVM.swift */, + EC1491A12A361B7600B2D47A /* ManagerVM.swift */, + ); + path = ViewModel; + sourceTree = ""; + }; + EC243A972A1FA0440017C10A = { + isa = PBXGroup; + children = ( + EC97FE462A378D9C007AEC0A /* Views */, + EC14919B2A35E97F00B2D47A /* ViewModel */, + EC1491902A35B70500B2D47A /* Model */, + EC14918B2A20DEEB00B2D47A /* Utile */, + EC243AA22A1FA0440017C10A /* CalculMoy */, + EC243AB32A1FA0460017C10A /* CalculMoyTests */, + EC243ABD2A1FA0460017C10A /* CalculMoyUITests */, + EC243AA12A1FA0440017C10A /* Products */, + ); + sourceTree = ""; + }; + EC243AA12A1FA0440017C10A /* Products */ = { + isa = PBXGroup; + children = ( + EC243AA02A1FA0440017C10A /* CalculMoy.app */, + EC243AB02A1FA0460017C10A /* CalculMoyTests.xctest */, + EC243ABA2A1FA0460017C10A /* CalculMoyUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + EC243AA22A1FA0440017C10A /* CalculMoy */ = { + isa = PBXGroup; + children = ( + EC243AA32A1FA0440017C10A /* CalculMoyApp.swift */, + EC243AA52A1FA0440017C10A /* ContentView.swift */, + EC243AA72A1FA0460017C10A /* Assets.xcassets */, + EC243AA92A1FA0460017C10A /* Preview Content */, + EC1491892A20D64500B2D47A /* Block.swift */, + EC14918E2A29F05A00B2D47A /* UsList.swift */, + ); + path = CalculMoy; + sourceTree = ""; + }; + EC243AA92A1FA0460017C10A /* Preview Content */ = { + isa = PBXGroup; + children = ( + EC243AAA2A1FA0460017C10A /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + EC243AB32A1FA0460017C10A /* CalculMoyTests */ = { + isa = PBXGroup; + children = ( + EC243AB42A1FA0460017C10A /* CalculMoyTests.swift */, + ); + path = CalculMoyTests; + sourceTree = ""; + }; + EC243ABD2A1FA0460017C10A /* CalculMoyUITests */ = { + isa = PBXGroup; + children = ( + EC243ABE2A1FA0460017C10A /* CalculMoyUITests.swift */, + EC243AC02A1FA0460017C10A /* CalculMoyUITestsLaunchTests.swift */, + ); + path = CalculMoyUITests; + sourceTree = ""; + }; + EC97FE462A378D9C007AEC0A /* Views */ = { + isa = PBXGroup; + children = ( + EC97FE472A378DBE007AEC0A /* Components */, + ); + path = Views; + sourceTree = ""; + }; + EC97FE472A378DBE007AEC0A /* Components */ = { + isa = PBXGroup; + children = ( + EC97FE482A378E59007AEC0A /* UEView.swift */, + EC97FE4A2A3798B7007AEC0A /* ModuleView.swift */, + EC97FE4C2A37A9F6007AEC0A /* UISliderView.swift */, + ); + path = Components; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + EC243A9F2A1FA0440017C10A /* CalculMoy */ = { + isa = PBXNativeTarget; + buildConfigurationList = EC243AC42A1FA0460017C10A /* Build configuration list for PBXNativeTarget "CalculMoy" */; + buildPhases = ( + EC243A9C2A1FA0440017C10A /* Sources */, + EC243A9D2A1FA0440017C10A /* Frameworks */, + EC243A9E2A1FA0440017C10A /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = CalculMoy; + productName = CalculMoy; + productReference = EC243AA02A1FA0440017C10A /* CalculMoy.app */; + productType = "com.apple.product-type.application"; + }; + EC243AAF2A1FA0460017C10A /* CalculMoyTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = EC243AC72A1FA0460017C10A /* Build configuration list for PBXNativeTarget "CalculMoyTests" */; + buildPhases = ( + EC243AAC2A1FA0460017C10A /* Sources */, + EC243AAD2A1FA0460017C10A /* Frameworks */, + EC243AAE2A1FA0460017C10A /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + EC243AB22A1FA0460017C10A /* PBXTargetDependency */, + ); + name = CalculMoyTests; + productName = CalculMoyTests; + productReference = EC243AB02A1FA0460017C10A /* CalculMoyTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + EC243AB92A1FA0460017C10A /* CalculMoyUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = EC243ACA2A1FA0460017C10A /* Build configuration list for PBXNativeTarget "CalculMoyUITests" */; + buildPhases = ( + EC243AB62A1FA0460017C10A /* Sources */, + EC243AB72A1FA0460017C10A /* Frameworks */, + EC243AB82A1FA0460017C10A /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + EC243ABC2A1FA0460017C10A /* PBXTargetDependency */, + ); + name = CalculMoyUITests; + productName = CalculMoyUITests; + productReference = EC243ABA2A1FA0460017C10A /* CalculMoyUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + EC243A982A1FA0440017C10A /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1410; + LastUpgradeCheck = 1410; + TargetAttributes = { + EC243A9F2A1FA0440017C10A = { + CreatedOnToolsVersion = 14.1; + }; + EC243AAF2A1FA0460017C10A = { + CreatedOnToolsVersion = 14.1; + TestTargetID = EC243A9F2A1FA0440017C10A; + }; + EC243AB92A1FA0460017C10A = { + CreatedOnToolsVersion = 14.1; + TestTargetID = EC243A9F2A1FA0440017C10A; + }; + }; + }; + buildConfigurationList = EC243A9B2A1FA0440017C10A /* Build configuration list for PBXProject "CalculMoy" */; + compatibilityVersion = "Xcode 14.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = EC243A972A1FA0440017C10A; + productRefGroup = EC243AA12A1FA0440017C10A /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + EC243A9F2A1FA0440017C10A /* CalculMoy */, + EC243AAF2A1FA0460017C10A /* CalculMoyTests */, + EC243AB92A1FA0460017C10A /* CalculMoyUITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + EC243A9E2A1FA0440017C10A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + EC243AAB2A1FA0460017C10A /* Preview Assets.xcassets in Resources */, + EC243AA82A1FA0460017C10A /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + EC243AAE2A1FA0460017C10A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + EC243AB82A1FA0460017C10A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + EC243A9C2A1FA0440017C10A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + EC97FE4B2A3798B7007AEC0A /* ModuleView.swift in Sources */, + EC1491962A35B91D00B2D47A /* UE.swift in Sources */, + EC14918F2A29F05A00B2D47A /* UsList.swift in Sources */, + EC14918A2A20D64500B2D47A /* Block.swift in Sources */, + EC14919F2A36022C00B2D47A /* UeVM.swift in Sources */, + EC97FE492A378E59007AEC0A /* UEView.swift in Sources */, + EC1491A22A361B7600B2D47A /* ManagerVM.swift in Sources */, + EC1491982A35BD3400B2D47A /* Stub.swift in Sources */, + EC243AA62A1FA0440017C10A /* ContentView.swift in Sources */, + EC14918D2A20DF2900B2D47A /* MySlider.swift in Sources */, + EC243AA42A1FA0440017C10A /* CalculMoyApp.swift in Sources */, + EC14919A2A35D15000B2D47A /* Manager.swift in Sources */, + EC97FE4D2A37A9F6007AEC0A /* UISliderView.swift in Sources */, + EC14919D2A35F60000B2D47A /* ModuleVM.swift in Sources */, + EC1491942A35B7CA00B2D47A /* Module.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + EC243AAC2A1FA0460017C10A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + EC243AB52A1FA0460017C10A /* CalculMoyTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + EC243AB62A1FA0460017C10A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + EC243AC12A1FA0460017C10A /* CalculMoyUITestsLaunchTests.swift in Sources */, + EC243ABF2A1FA0460017C10A /* CalculMoyUITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + EC243AB22A1FA0460017C10A /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = EC243A9F2A1FA0440017C10A /* CalculMoy */; + targetProxy = EC243AB12A1FA0460017C10A /* PBXContainerItemProxy */; + }; + EC243ABC2A1FA0460017C10A /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = EC243A9F2A1FA0440017C10A /* CalculMoy */; + targetProxy = EC243ABB2A1FA0460017C10A /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + EC243AC22A1FA0460017C10A /* 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++20"; + 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 = 16.1; + 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; + }; + EC243AC32A1FA0460017C10A /* 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++20"; + 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 = 16.1; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + EC243AC52A1FA0460017C10A /* 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 = "\"CalculMoy/Preview Content\""; + 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"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = fr.uca.iut.CalculMoy; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + EC243AC62A1FA0460017C10A /* 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 = "\"CalculMoy/Preview Content\""; + 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"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = fr.uca.iut.CalculMoy; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + EC243AC82A1FA0460017C10A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 16.1; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = fr.uca.iut.CalculMoyTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CalculMoy.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/CalculMoy"; + }; + name = Debug; + }; + EC243AC92A1FA0460017C10A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 16.1; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = fr.uca.iut.CalculMoyTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CalculMoy.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/CalculMoy"; + }; + name = Release; + }; + EC243ACB2A1FA0460017C10A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = fr.uca.iut.CalculMoyUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = CalculMoy; + }; + name = Debug; + }; + EC243ACC2A1FA0460017C10A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = fr.uca.iut.CalculMoyUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = CalculMoy; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + EC243A9B2A1FA0440017C10A /* Build configuration list for PBXProject "CalculMoy" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + EC243AC22A1FA0460017C10A /* Debug */, + EC243AC32A1FA0460017C10A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + EC243AC42A1FA0460017C10A /* Build configuration list for PBXNativeTarget "CalculMoy" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + EC243AC52A1FA0460017C10A /* Debug */, + EC243AC62A1FA0460017C10A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + EC243AC72A1FA0460017C10A /* Build configuration list for PBXNativeTarget "CalculMoyTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + EC243AC82A1FA0460017C10A /* Debug */, + EC243AC92A1FA0460017C10A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + EC243ACA2A1FA0460017C10A /* Build configuration list for PBXNativeTarget "CalculMoyUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + EC243ACB2A1FA0460017C10A /* Debug */, + EC243ACC2A1FA0460017C10A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = EC243A982A1FA0440017C10A /* Project object */; +} diff --git a/CalculMoy/CalculMoy.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CalculMoy/CalculMoy.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/CalculMoy/CalculMoy.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CalculMoy/CalculMoy.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/CalculMoy/CalculMoy.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/CalculMoy/CalculMoy.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/CalculMoy/CalculMoy.xcodeproj/project.xcworkspace/xcuserdata/etudiant.xcuserdatad/UserInterfaceState.xcuserstate b/CalculMoy/CalculMoy.xcodeproj/project.xcworkspace/xcuserdata/etudiant.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..bfb6737 Binary files /dev/null and b/CalculMoy/CalculMoy.xcodeproj/project.xcworkspace/xcuserdata/etudiant.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CalculMoy/CalculMoy.xcodeproj/xcuserdata/etudiant.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CalculMoy/CalculMoy.xcodeproj/xcuserdata/etudiant.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..90d58ac --- /dev/null +++ b/CalculMoy/CalculMoy.xcodeproj/xcuserdata/etudiant.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,6 @@ + + + diff --git a/CalculMoy/CalculMoy.xcodeproj/xcuserdata/etudiant.xcuserdatad/xcschemes/xcschememanagement.plist b/CalculMoy/CalculMoy.xcodeproj/xcuserdata/etudiant.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..8724348 --- /dev/null +++ b/CalculMoy/CalculMoy.xcodeproj/xcuserdata/etudiant.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + CalculMoy.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/CalculMoy/CalculMoy/.DS_Store b/CalculMoy/CalculMoy/.DS_Store new file mode 100644 index 0000000..745f6cf Binary files /dev/null and b/CalculMoy/CalculMoy/.DS_Store differ diff --git a/CalculMoy/CalculMoy/Assets.xcassets/.DS_Store b/CalculMoy/CalculMoy/Assets.xcassets/.DS_Store new file mode 100644 index 0000000..c06a545 Binary files /dev/null and b/CalculMoy/CalculMoy/Assets.xcassets/.DS_Store differ diff --git a/CalculMoy/CalculMoy/Assets.xcassets/AccentColor.colorset/Contents.json b/CalculMoy/CalculMoy/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/CalculMoy/CalculMoy/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/CalculMoy/CalculMoy/Assets.xcassets/AppIcon.appiconset/Contents.json b/CalculMoy/CalculMoy/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..13613e3 --- /dev/null +++ b/CalculMoy/CalculMoy/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,13 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/CalculMoy/CalculMoy/Assets.xcassets/Contents.json b/CalculMoy/CalculMoy/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/CalculMoy/CalculMoy/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/CalculMoy/CalculMoy/Block.swift b/CalculMoy/CalculMoy/Block.swift new file mode 100644 index 0000000..692cd7c --- /dev/null +++ b/CalculMoy/CalculMoy/Block.swift @@ -0,0 +1,57 @@ +// +// Block.swift +// CalculMoy +// +// Created by etudiant on 26/05/2023. +// + +import SwiftUI + +struct Block: View { + public var title : String + public var coeff : Int + public var note : Float + + + var body: some View { + NavigationStack{ + HStack{ + VStack{ + HStack{ + Text(title) + Spacer() + Text(String(coeff)) + } + .padding(.horizontal) + HStack{ + Rectangle() + .frame(width: CGFloat(Int(note)) * 10, height: 30) + .cornerRadius(20) + .foregroundColor((note < 10 ? .red : .green)) + Text(String(note)) + Spacer() + + } + .padding(.horizontal) + Divider() + } + /*NavigationLink(destination: UEView()){ + Image(systemName: "square.and.pencil") + }*/ + Button{ + }label: { + Image(systemName: "square.and.pencil") + } + + Divider() + .padding(.horizontal) + } + + } + } +} +struct Block_Previews: PreviewProvider { + static var previews: some View { + Block(title: "UE - Génie logiciel", coeff: 6,note: 14) + } +} diff --git a/CalculMoy/CalculMoy/CalculMoyApp.swift b/CalculMoy/CalculMoy/CalculMoyApp.swift new file mode 100644 index 0000000..65897a0 --- /dev/null +++ b/CalculMoy/CalculMoy/CalculMoyApp.swift @@ -0,0 +1,17 @@ +// +// CalculMoyApp.swift +// CalculMoy +// +// Created by etudiant on 25/05/2023. +// + +import SwiftUI + +@main +struct CalculMoyApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } +} diff --git a/CalculMoy/CalculMoy/ContentView.swift b/CalculMoy/CalculMoy/ContentView.swift new file mode 100644 index 0000000..ccd8d5f --- /dev/null +++ b/CalculMoy/CalculMoy/ContentView.swift @@ -0,0 +1,64 @@ +// +// ContentView.swift +// CalculMoy +// +// Created by etudiant on 25/05/2023. +// + +import SwiftUI + +struct ContentView: View { + var body: some View { + + + NavigationStack{ + + ScrollView(){ + VStack(alignment: .leading){ + Text("UEs") + .font(.largeTitle) + .bold() + .padding(.leading, 15.0) + .frame(alignment: .leading) + + Text("Détail des UEs") + .padding(.leading, 15.0) + .frame(alignment: .leading) + + Group{ + Block(title: "UE - Génie logiciel", coeff: 6,note: 14) + Block(title: "UE - Génie logiciel", coeff: 6,note: 9) + Block(title: "UE - Génie logiciel", coeff: 9,note: 18) + Block(title: "UE - Génie logiciel", coeff: 9,note: 18) + Block(title: "UE - Génie logiciel", coeff: 9,note: 18) + } + Group{ + Block(title: "UE - Génie logiciel", coeff: 9,note: 18) + Block(title: "UE - Génie logiciel", coeff: 9,note: 18) + Block(title: "UE - Génie logiciel", coeff: 9,note: 18) + Block(title: "UE - Génie logiciel", coeff: 9,note: 18) + Block(title: "UE - Génie logiciel", coeff: 9,note: 18) + } + + + + + } + + + + + }.multilineTextAlignment(.leading) + .navigationTitle("Calculette") + + + + } + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + } +} diff --git a/CalculMoy/CalculMoy/Preview Content/Preview Assets.xcassets/Contents.json b/CalculMoy/CalculMoy/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/CalculMoy/CalculMoy/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/CalculMoy/CalculMoy/UsList.swift b/CalculMoy/CalculMoy/UsList.swift new file mode 100644 index 0000000..0bcc61f --- /dev/null +++ b/CalculMoy/CalculMoy/UsList.swift @@ -0,0 +1,62 @@ +// +// UsList.swift +// CalculMoy +// +// Created by etudiant on 02/06/2023. +// + +import SwiftUI + +struct UsList: View { + var body: some View { + NavigationStack{ + + ScrollView(){ + VStack(alignment: .leading){ + Text("UE- ") + .font(.largeTitle) + .bold() + .padding(.leading, 15.0) + .frame(alignment: .leading) + + Text("Détail des UEs") + .padding(.leading, 15.0) + .frame(alignment: .leading) + + Group{ + Block(title: "UE - Génie logiciel", coeff: 6,note: 14) + Block(title: "UE - Génie logiciel", coeff: 6,note: 9) + Block(title: "UE - Génie logiciel", coeff: 9,note: 18) + Block(title: "UE - Génie logiciel", coeff: 9,note: 18) + Block(title: "UE - Génie logiciel", coeff: 9,note: 18) + } + Group{ + Block(title: "UE - Génie logiciel", coeff: 9,note: 18) + Block(title: "UE - Génie logiciel", coeff: 9,note: 18) + Block(title: "UE - Génie logiciel", coeff: 9,note: 18) + Block(title: "UE - Génie logiciel", coeff: 9,note: 18) + Block(title: "UE - Génie logiciel", coeff: 9,note: 18) + } + + + + + } + + + + + }.multilineTextAlignment(.leading) + .navigationTitle("Details") + + + + } + } +} + +struct UsList_Previews: PreviewProvider { + static var previews: some View { + UsList() + } +} diff --git a/CalculMoy/CalculMoyTests/CalculMoyTests.swift b/CalculMoy/CalculMoyTests/CalculMoyTests.swift new file mode 100644 index 0000000..e5f7dc3 --- /dev/null +++ b/CalculMoy/CalculMoyTests/CalculMoyTests.swift @@ -0,0 +1,36 @@ +// +// CalculMoyTests.swift +// CalculMoyTests +// +// Created by etudiant on 25/05/2023. +// + +import XCTest +@testable import CalculMoy + +final class CalculMoyTests: XCTestCase { + + override func setUpWithError() throws { + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDownWithError() throws { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + func testExample() throws { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. + // Any test you write for XCTest can be annotated as throws and async. + // Mark your test throws to produce an unexpected failure when your test encounters an uncaught error. + // Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards. + } + + func testPerformanceExample() throws { + // This is an example of a performance test case. + self.measure { + // Put the code you want to measure the time of here. + } + } + +} diff --git a/CalculMoy/CalculMoyUITests/CalculMoyUITests.swift b/CalculMoy/CalculMoyUITests/CalculMoyUITests.swift new file mode 100644 index 0000000..928593b --- /dev/null +++ b/CalculMoy/CalculMoyUITests/CalculMoyUITests.swift @@ -0,0 +1,41 @@ +// +// CalculMoyUITests.swift +// CalculMoyUITests +// +// Created by etudiant on 25/05/2023. +// + +import XCTest + +final class CalculMoyUITests: XCTestCase { + + override func setUpWithError() throws { + // Put setup code here. This method is called before the invocation of each test method in the class. + + // In UI tests it is usually best to stop immediately when a failure occurs. + continueAfterFailure = false + + // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. + } + + override func tearDownWithError() throws { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + func testExample() throws { + // UI tests must launch the application that they test. + let app = XCUIApplication() + app.launch() + + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + + func testLaunchPerformance() throws { + if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) { + // This measures how long it takes to launch your application. + measure(metrics: [XCTApplicationLaunchMetric()]) { + XCUIApplication().launch() + } + } + } +} diff --git a/CalculMoy/CalculMoyUITests/CalculMoyUITestsLaunchTests.swift b/CalculMoy/CalculMoyUITests/CalculMoyUITestsLaunchTests.swift new file mode 100644 index 0000000..09671b3 --- /dev/null +++ b/CalculMoy/CalculMoyUITests/CalculMoyUITestsLaunchTests.swift @@ -0,0 +1,32 @@ +// +// CalculMoyUITestsLaunchTests.swift +// CalculMoyUITests +// +// Created by etudiant on 25/05/2023. +// + +import XCTest + +final class CalculMoyUITestsLaunchTests: XCTestCase { + + override class var runsForEachTargetApplicationUIConfiguration: Bool { + true + } + + override func setUpWithError() throws { + continueAfterFailure = false + } + + func testLaunch() throws { + let app = XCUIApplication() + app.launch() + + // Insert steps here to perform after app launch but before taking a screenshot, + // such as logging into a test account or navigating somewhere in the app + + let attachment = XCTAttachment(screenshot: app.screenshot()) + attachment.name = "Launch Screen" + attachment.lifetime = .keepAlways + add(attachment) + } +} diff --git a/CalculMoy/Model/Manager.swift b/CalculMoy/Model/Manager.swift new file mode 100644 index 0000000..1fd23ae --- /dev/null +++ b/CalculMoy/Model/Manager.swift @@ -0,0 +1,23 @@ +// +// Manager.swift +// CalculMoy +// +// Created by etudiant on 11/06/2023. +// + +import Foundation + +struct Manager { + public var ues:[UE] + + + public init(ues: [UE]) { + self.ues = ues + } + + mutating func getData(){ + self.ues = Stub.uesData + } + + +} diff --git a/CalculMoy/Model/Module.swift b/CalculMoy/Model/Module.swift new file mode 100644 index 0000000..793c0bd --- /dev/null +++ b/CalculMoy/Model/Module.swift @@ -0,0 +1,15 @@ +// +// Module.swift +// CalculMoy +// +// Created by etudiant on 11/06/2023. +// + +import Foundation + +struct Module{ + let id: UUID + var moduleName: String + var coef: Int + var note: Double? +} diff --git a/CalculMoy/Model/Stub.swift b/CalculMoy/Model/Stub.swift new file mode 100644 index 0000000..7e50a56 --- /dev/null +++ b/CalculMoy/Model/Stub.swift @@ -0,0 +1,69 @@ +// +// Stub.swift +// CalculMoy +// +// Created by etudiant on 11/06/2023. +// + +import Foundation + +struct Stub{ + static let uesData:[UE] = [ + UE( + id: UUID(), + ueName: "UE - 1", + coef: 9, + modules: [ + Module(id: UUID(), moduleName: "Module - 1", coef: 2, note: 4), + Module(id: UUID(), moduleName: "Module - 2", coef: 3, note: 14), + Module(id: UUID(), moduleName: "Module - 3", coef: 5, note: 10), + Module(id: UUID(), moduleName: "Module - 4", coef: 2, note: 9), + ] + ), + UE( + id: UUID(), + ueName: "UE - 2", + coef: 9, + modules: [ + Module(id: UUID(), moduleName: "Module - 1", coef: 2, note: 4), + Module(id: UUID(), moduleName: "Module - 2", coef: 3, note: 14), + Module(id: UUID(), moduleName: "Module - 3", coef: 5, note: 10), + Module(id: UUID(), moduleName: "Module - 4", coef: 2, note: 9), + ] + ), + UE( + id: UUID(), + ueName: "UE - 3", + coef: 9, + modules: [ + Module(id: UUID(), moduleName: "Module - 1", coef: 2, note: 4), + Module(id: UUID(), moduleName: "Module - 2", coef: 3, note: 14), + Module(id: UUID(), moduleName: "Module - 3", coef: 5, note: 10), + Module(id: UUID(), moduleName: "Module - 4", coef: 2, note: 9), + ] + ), + UE( + id: UUID(), + ueName: "UE - 4", + coef: 9, + modules: [ + Module(id: UUID(), moduleName: "Module - 1", coef: 2, note: 4), + Module(id: UUID(), moduleName: "Module - 2", coef: 3, note: 14), + Module(id: UUID(), moduleName: "Module - 3", coef: 5, note: 10), + Module(id: UUID(), moduleName: "Module - 4", coef: 2, note: 9), + ] + ), + UE( + id: UUID(), + ueName: "UE - 5", + coef: 9, + modules: [ + Module(id: UUID(), moduleName: "Module - 1", coef: 2, note: 4), + Module(id: UUID(), moduleName: "Module - 2", coef: 3, note: 14), + Module(id: UUID(), moduleName: "Module - 3", coef: 5, note: 10), + Module(id: UUID(), moduleName: "Module - 4", coef: 2, note: 9), + ] + ), + + ] +} diff --git a/CalculMoy/Model/UE.swift b/CalculMoy/Model/UE.swift new file mode 100644 index 0000000..b11f7d9 --- /dev/null +++ b/CalculMoy/Model/UE.swift @@ -0,0 +1,18 @@ +// +// UE.swift +// CalculMoy +// +// Created by etudiant on 11/06/2023. +// + +import Foundation + +struct UE { + let id: UUID + var ueName: String + var coef: Int + var note: Double? + var modules: [Module] + + +} diff --git a/CalculMoy/Utile/MySlider.swift b/CalculMoy/Utile/MySlider.swift new file mode 100644 index 0000000..c54502a --- /dev/null +++ b/CalculMoy/Utile/MySlider.swift @@ -0,0 +1,28 @@ +// +// MySlider.swift +// CalculMoy +// +// Created by etudiant on 26/05/2023. +// + +import SwiftUI + +struct MySlider: View { + var body: some View { + GeometryReader{metrics in + Rectangle() + //.frame(width: metrics.size.width, height: 30) + //.background((.green) + ZStack{ + Text("hello").foregroundColor(.red) + } + + } + } +} + +struct MySlider_Previews: PreviewProvider { + static var previews: some View { + MySlider() + } +} diff --git a/CalculMoy/ViewModel/ManagerVM.swift b/CalculMoy/ViewModel/ManagerVM.swift new file mode 100644 index 0000000..c951b32 --- /dev/null +++ b/CalculMoy/ViewModel/ManagerVM.swift @@ -0,0 +1,55 @@ +// +// ManagerVM.swift +// CalculMoy +// +// Created by etudiant on 11/06/2023. +// + +import Foundation + +class ManagerVM:ObservableObject{ + @Published var ueList: [UeVM] + + init(ueList: [UeVM]) { + self.ueList = ueList + } + + init(manager:Manager){ + ueList=[] + for ue in manager.ues{ + ueList.append(UeVM(ue: ue)) + } + } + + init(){ + ueList=[] + addUEs(ues: Stub.uesData) + } + + func addUEs(ues: [UE]){ + for ue in ues { + ueList.append(UeVM(ue: ue)) + } + } + + + + public func getMoyGeneral()->Double?{ + var coef = 0 + var somme = 0.0 + + + for ue in ueList { + if let note = ue.note{ + coef += ue.coef + somme += note * Double(ue.coef) + } + } + + if coef == 0 { + return nil + } + + return somme / Double(coef) + } +} diff --git a/CalculMoy/ViewModel/ModuleVM.swift b/CalculMoy/ViewModel/ModuleVM.swift new file mode 100644 index 0000000..2fe7a30 --- /dev/null +++ b/CalculMoy/ViewModel/ModuleVM.swift @@ -0,0 +1,32 @@ +// +// ModuleVM.swift +// CalculMoy +// +// Created by etudiant on 11/06/2023. +// + +import Foundation + + + +class ModuleVM : ObservableObject{ + let id: UUID + @Published var moduleName: String + @Published var coef: Int + @Published var note: Double? + + + public init(id: UUID, moduleName: String, coef: Int, note: Double? = nil) { + self.id = id + self.moduleName = moduleName + self.coef = coef + self.note = note + } + + public init(module: Module){ + self.id = module.id + self.moduleName = module.moduleName + self.coef = module.coef + self.note = module.note + } +} diff --git a/CalculMoy/ViewModel/UeVM.swift b/CalculMoy/ViewModel/UeVM.swift new file mode 100644 index 0000000..1faba17 --- /dev/null +++ b/CalculMoy/ViewModel/UeVM.swift @@ -0,0 +1,72 @@ +// +// UeVM.swift +// CalculMoy +// +// Created by etudiant on 11/06/2023. +// + +import Foundation + +class UeVM:ObservableObject{ + + let id: UUID + @Published var ueName: String + @Published var coef: Int + @Published var note: Double? + @Published var moduleVMs: [ModuleVM] + + func calculMoy()->Double?{ + var coef = 0 + var somme = 0.0 + + for module in moduleVMs { + if let note = module.note { + coef += module.coef + somme += note * Double(module.coef) + } + + } + + if coef == 0 { + return nil + } + + return somme / Double(coef) + + } + + public init(id: UUID, ueName: String, coef: Int, note: Double? = nil, modules: [ModuleVM]) { + self.id = id + self.ueName = ueName + self.coef = coef + self.note = note + self.moduleVMs = modules + } + + public init (ue: UE){ + id = ue.id + ueName = ue.ueName + coef = ue.coef + note = ue.note + moduleVMs=[] + for module in ue.modules { + moduleVMs.append(ModuleVM(module: module)) + } + } + + + + public func addModuleVM(moduleVM: ModuleVM){ + moduleVMs.append(moduleVM) + } + + public func deleteModuleVM(modduleVM: ModuleVM){ + guard let x = getIndexById(id: modduleVM.id) else {return} + moduleVMs.remove(at: x) + } + + func getIndexById(id:UUID)->Int?{ + return moduleVMs.firstIndex(where: {$0.id == id}) + } + +} diff --git a/CalculMoy/Views/Components/ModuleView.swift b/CalculMoy/Views/Components/ModuleView.swift new file mode 100644 index 0000000..1230229 --- /dev/null +++ b/CalculMoy/Views/Components/ModuleView.swift @@ -0,0 +1,118 @@ +// +// ModuleView.swift +// CalculMoy +// +// Created by etudiant on 12/06/2023. +// + +import SwiftUI + + +final class Slider: UISlider { + + override func draw(_ rect: CGRect) { + super.draw(rect) + setup() + } + + private func setup() { + clear() + } + + private func clear() { + tintColor = .clear + maximumTrackTintColor = .clear + backgroundColor = .clear + thumbTintColor = .clear + } +} + + +struct ModuleView: View { + + @ObservedObject var moduleVM:ModuleVM + @ObservedObject var ueVm: UeVM + @ObservedObject var managerVm: ManagerVM + @State private var editable:Bool=false + + + + + var body: some View { + + HStack{ + + + + VStack{ + + HStack{ + Text("> " + moduleVM.moduleName) + Spacer() + Text(String(moduleVM.coef)) + } + + HStack{ + + if let note = moduleVM.note{ + + UISliderView( + value: Binding( + get: {note}, set: { + newValue in + if editable{ + moduleVM.note = newValue + } + + } ), + editable: $editable, + minValue: 0.0, + maxValue: 20.00 + + + ).disabled(!editable) + .scaleEffect(x: 1, y: 4, anchor: .center) + + + + + + } + if let note = moduleVM.note{ + + Text(String(format: "%.2f",note)) + } + + + } + + + + + + }.padding(10) + Button{ + //do somthing + editable = !editable + }label: { + Image(systemName: "square.and.pencil") + }.foregroundColor( + editable ? .green : .gray + ) + + } + + } +} + +struct ModuleView_Previews: PreviewProvider { + + static var managerData:ManagerVM=ManagerVM( + manager: Manager(ues: Stub.uesData) + ) + static var previews: some View { + ModuleView( + moduleVM: ModuleVM(module: Stub.uesData[0].modules[0]), ueVm: UeVM(ue: Stub.uesData[0]), managerVm: managerData + ) + } +} diff --git a/CalculMoy/Views/Components/UEView.swift b/CalculMoy/Views/Components/UEView.swift new file mode 100644 index 0000000..d9f7c6f --- /dev/null +++ b/CalculMoy/Views/Components/UEView.swift @@ -0,0 +1,54 @@ +// +// UEView.swift +// CalculMoy +// +// Created by etudiant on 12/06/2023. +// + +import SwiftUI + +struct UEView: View { + + @ObservedObject var ueVm: UeVM + @ObservedObject var managerVm: ManagerVM + + var body: some View { + VStack{ + + HStack{ + Text("> " + ueVm.ueName) + Spacer() + Text(String(ueVm.coef)) + } + + HStack{ + if let note = ueVm.calculMoy(){ + ProgressView(value: note,total: 20) + .accentColor(note < 10 ? .red : .green) + .scaleEffect(x: 1, y: 4, anchor: .center) + Text(String(format: "%.2f",note)) + } + + } + + + } + .padding() + .background(Color.gray.opacity(0.2)) + .cornerRadius(12) + .padding(.horizontal) + } +} + +struct UEView_Previews: PreviewProvider { + + static var managerData:ManagerVM=ManagerVM( + manager: Manager(ues: Stub.uesData) + ) + + static var previews: some View { + UEView( + ueVm: UeVM(ue: Stub.uesData[0]) , managerVm: managerData + ) + } +} diff --git a/CalculMoy/Views/Components/UISliderView.swift b/CalculMoy/Views/Components/UISliderView.swift new file mode 100644 index 0000000..064bb75 --- /dev/null +++ b/CalculMoy/Views/Components/UISliderView.swift @@ -0,0 +1,145 @@ +// +// MySlider.swift +// CalculMoy +// +// Created by etudiant on 12/06/2023. +// + +import SwiftUI + +struct UISliderView: UIViewRepresentable { + + @Binding var value: Double + @Binding var editable: Bool + + + + var minValue = 1.0 + + var maxValue = 100.0 + + var thumbColor: UIColor = UIColor(Color.black.opacity(0)) + + var minTrackColor: UIColor = .red + + var maxTrackColor: UIColor = .lightGray + + + + + + class Coordinator: NSObject { + + var value: Binding + + + + init(value: Binding) { + + self.value = value + + } + + + + @objc func valueChanged(_ sender: UISlider) { + + self.value.wrappedValue = Double(sender.value) + + } + + } + + + + func makeCoordinator() -> UISliderView.Coordinator { + + Coordinator(value: $value) + + } + + + + func makeUIView(context: Context) -> UISlider { + + let slider = UISlider(frame: .zero) + + slider.thumbTintColor = thumbColor + + slider.minimumTrackTintColor = minTrackColor + + slider.maximumTrackTintColor = maxTrackColor + + slider.minimumValue = Float(minValue) + + slider.maximumValue = Float(maxValue) + + + + + + + + if editable{ + slider.value = Float(value) + } + + + + + + + slider.addTarget( + + context.coordinator, + + action: #selector(Coordinator.valueChanged(_:)), + + for: .valueChanged + + ) + + + + return slider + + } + + + + func updateUIView(_ uiView: UISlider, context: Context) { + + + + uiView.value = Float(value) + uiView.minimumTrackTintColor = value > 10 ? .green : .red + + } + +} + + +struct UISliderView_Previews: PreviewProvider { + private var currentValue = 6.0 + + static var previews: some View { +// UISliderView(value: Binding( +// get: {currentValue},set: { value in +// currentValue +// } +// +// +// ), +// +// minValue: 1.0, +// +// maxValue: 10.0, +// +// thumbColor: .red, +// +// minTrackColor: .purple, +// +// maxTrackColor: .green) + Text("je") + } +} diff --git a/MyPlayground.playground/Contents.swift b/MyPlayground.playground/Contents.swift new file mode 100644 index 0000000..9d86688 --- /dev/null +++ b/MyPlayground.playground/Contents.swift @@ -0,0 +1,3 @@ +import UIKit + +var greeting = "Hello, playground" diff --git a/MyPlayground.playground/contents.xcplayground b/MyPlayground.playground/contents.xcplayground new file mode 100644 index 0000000..7627317 --- /dev/null +++ b/MyPlayground.playground/contents.xcplayground @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/MyPlayground.playground/playground.xcworkspace/contents.xcworkspacedata b/MyPlayground.playground/playground.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/MyPlayground.playground/playground.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/MyPlayground.playground/playground.xcworkspace/xcuserdata/etudiant.xcuserdatad/UserInterfaceState.xcuserstate b/MyPlayground.playground/playground.xcworkspace/xcuserdata/etudiant.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..e860b98 Binary files /dev/null and b/MyPlayground.playground/playground.xcworkspace/xcuserdata/etudiant.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/MyPlayground.playground/timeline.xctimeline b/MyPlayground.playground/timeline.xctimeline new file mode 100644 index 0000000..bf468af --- /dev/null +++ b/MyPlayground.playground/timeline.xctimeline @@ -0,0 +1,6 @@ + + + + +