master
Arafamamadouellaphi 2 years ago
parent 21658f0136
commit 2011f97927

@ -14,23 +14,30 @@
EC1A52732A1CE12A00F8CC93 /* SwiftMvvmTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC1A52722A1CE12A00F8CC93 /* SwiftMvvmTests.swift */; }; EC1A52732A1CE12A00F8CC93 /* SwiftMvvmTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC1A52722A1CE12A00F8CC93 /* SwiftMvvmTests.swift */; };
EC1A527D2A1CE12A00F8CC93 /* SwiftMvvmUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC1A527C2A1CE12A00F8CC93 /* SwiftMvvmUITests.swift */; }; EC1A527D2A1CE12A00F8CC93 /* SwiftMvvmUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC1A527C2A1CE12A00F8CC93 /* SwiftMvvmUITests.swift */; };
EC1A527F2A1CE12A00F8CC93 /* SwiftMvvmUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC1A527E2A1CE12A00F8CC93 /* SwiftMvvmUITestsLaunchTests.swift */; }; EC1A527F2A1CE12A00F8CC93 /* SwiftMvvmUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC1A527E2A1CE12A00F8CC93 /* SwiftMvvmUITestsLaunchTests.swift */; };
EC1A528C2A1CE77F00F8CC93 /* HomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC1A528B2A1CE77F00F8CC93 /* HomeView.swift */; };
EC2E21F42A25E9FA00DED570 /* MatiereUniq.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC2E21F32A25E9FA00DED570 /* MatiereUniq.swift */; };
EC2E21F82A25FCAA00DED570 /* stbmat.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC2E21F72A25FCAA00DED570 /* stbmat.swift */; };
EC369C212A325FB5005EE7C8 /* Note.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC369C202A325FB5005EE7C8 /* Note.swift */; };
EC47F9D62A34C50C00CA3A3F /* DataManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC47F9D52A34C50C00CA3A3F /* DataManager.swift */; }; EC47F9D62A34C50C00CA3A3F /* DataManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC47F9D52A34C50C00CA3A3F /* DataManager.swift */; };
EC47F9D82A34C62000CA3A3F /* Manager.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC47F9D72A34C62000CA3A3F /* Manager.swift */; };
EC47F9DA2A34C73B00CA3A3F /* Stub.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC47F9D92A34C73B00CA3A3F /* Stub.swift */; }; EC47F9DA2A34C73B00CA3A3F /* Stub.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC47F9D92A34C73B00CA3A3F /* Stub.swift */; };
EC47F9DC2A34D36200CA3A3F /* EditableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC47F9DB2A34D36200CA3A3F /* EditableView.swift */; };
EC47F9E02A34F00C00CA3A3F /* MatiereEditView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC47F9DF2A34F00C00CA3A3F /* MatiereEditView.swift */; };
EC47F9E22A35E89400CA3A3F /* UeeVm.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC47F9E12A35E89400CA3A3F /* UeeVm.swift */; }; EC47F9E22A35E89400CA3A3F /* UeeVm.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC47F9E12A35E89400CA3A3F /* UeeVm.swift */; };
EC47F9E42A35EF1800CA3A3F /* ArrayExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC47F9E32A35EF1800CA3A3F /* ArrayExtension.swift */; }; EC47F9E42A35EF1800CA3A3F /* ArrayExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC47F9E32A35EF1800CA3A3F /* ArrayExtension.swift */; };
EC47F9E62A3633DA00CA3A3F /* ManagerVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC47F9E52A3633DA00CA3A3F /* ManagerVM.swift */; }; EC47F9E62A3633DA00CA3A3F /* DataManagerVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC47F9E52A3633DA00CA3A3F /* DataManagerVM.swift */; };
EC7725432A1F80980075CBBF /* BlocView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC7725422A1F80980075CBBF /* BlocView.swift */; }; EC7692E82A4565ED00F9F644 /* UeCollection.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC7692E72A4565ED00F9F644 /* UeCollection.swift */; };
EC7692EA2A45660500F9F644 /* MatiereCollection.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC7692E92A45660500F9F644 /* MatiereCollection.swift */; };
EC7692EC2A45661C00F9F644 /* BlocCollection.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC7692EB2A45661C00F9F644 /* BlocCollection.swift */; };
EC7692EE2A45667700F9F644 /* CollectionVMUe.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC7692ED2A45667700F9F644 /* CollectionVMUe.swift */; };
EC7692F02A45669000F9F644 /* MatiereCollectionVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC7692EF2A45669000F9F644 /* MatiereCollectionVM.swift */; };
EC7692F22A4566CF00F9F644 /* BlocCollectionVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC7692F12A4566CF00F9F644 /* BlocCollectionVM.swift */; };
EC7692F42A45680700F9F644 /* Home.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC7692F32A45680700F9F644 /* Home.swift */; };
EC7692F62A45683100F9F644 /* Uee.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC7692F52A45683100F9F644 /* Uee.swift */; };
EC7692F82A45685200F9F644 /* MatiereUnq.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC7692F72A45685200F9F644 /* MatiereUnq.swift */; };
EC7692FA2A45687000F9F644 /* edit.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC7692F92A45687000F9F644 /* edit.swift */; };
EC7692FC2A45689000F9F644 /* UeCapsule.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC7692FB2A45689000F9F644 /* UeCapsule.swift */; };
EC7692FE2A4568A900F9F644 /* MatiereCapsule.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC7692FD2A4568A900F9F644 /* MatiereCapsule.swift */; };
EC7693002A4568BD00F9F644 /* EditSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC7692FF2A4568BD00F9F644 /* EditSheet.swift */; };
EC7693022A4568D700F9F644 /* MatiereEditView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC7693012A4568D700F9F644 /* MatiereEditView.swift */; };
EC7693042A4568F300F9F644 /* BlockItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC7693032A4568F300F9F644 /* BlockItem.swift */; };
EC7693062A45691900F9F644 /* AddSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC7693052A45691900F9F644 /* AddSheet.swift */; };
EC7693082A456A2400F9F644 /* NoteColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC7693072A456A2400F9F644 /* NoteColor.swift */; };
EC76930A2A456B6B00F9F644 /* Block.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC7693092A456B6B00F9F644 /* Block.swift */; };
EC7725452A1F814A0075CBBF /* UeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC7725442A1F814A0075CBBF /* UeView.swift */; }; EC7725452A1F814A0075CBBF /* UeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC7725442A1F814A0075CBBF /* UeView.swift */; };
EC7725492A1F8DFE0075CBBF /* MatiereView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC7725482A1F8DFE0075CBBF /* MatiereView.swift */; };
EC77254B2A1F8E770075CBBF /* VuePrincipale.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC77254A2A1F8E770075CBBF /* VuePrincipale.swift */; };
EC77254D2A1F8EE90075CBBF /* ListUe.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC77254C2A1F8EE90075CBBF /* ListUe.swift */; };
EC7725542A1F90CF0075CBBF /* BlocModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC7725532A1F90CF0075CBBF /* BlocModel.swift */; }; EC7725542A1F90CF0075CBBF /* BlocModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC7725532A1F90CF0075CBBF /* BlocModel.swift */; };
EC7725562A1F90FD0075CBBF /* UE.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC7725552A1F90FD0075CBBF /* UE.swift */; }; EC7725562A1F90FD0075CBBF /* UE.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC7725552A1F90FD0075CBBF /* UE.swift */; };
EC7725582A1F91300075CBBF /* Matiere.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC7725572A1F91300075CBBF /* Matiere.swift */; }; EC7725582A1F91300075CBBF /* Matiere.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC7725572A1F91300075CBBF /* Matiere.swift */; };
@ -71,23 +78,30 @@
EC1A52782A1CE12A00F8CC93 /* SwiftMvvmUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwiftMvvmUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; EC1A52782A1CE12A00F8CC93 /* SwiftMvvmUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwiftMvvmUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
EC1A527C2A1CE12A00F8CC93 /* SwiftMvvmUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftMvvmUITests.swift; sourceTree = "<group>"; }; EC1A527C2A1CE12A00F8CC93 /* SwiftMvvmUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftMvvmUITests.swift; sourceTree = "<group>"; };
EC1A527E2A1CE12A00F8CC93 /* SwiftMvvmUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftMvvmUITestsLaunchTests.swift; sourceTree = "<group>"; }; EC1A527E2A1CE12A00F8CC93 /* SwiftMvvmUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftMvvmUITestsLaunchTests.swift; sourceTree = "<group>"; };
EC1A528B2A1CE77F00F8CC93 /* HomeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeView.swift; sourceTree = "<group>"; };
EC2E21F32A25E9FA00DED570 /* MatiereUniq.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MatiereUniq.swift; sourceTree = "<group>"; };
EC2E21F72A25FCAA00DED570 /* stbmat.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = stbmat.swift; sourceTree = "<group>"; };
EC369C202A325FB5005EE7C8 /* Note.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Note.swift; sourceTree = "<group>"; };
EC47F9D52A34C50C00CA3A3F /* DataManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataManager.swift; sourceTree = "<group>"; }; EC47F9D52A34C50C00CA3A3F /* DataManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataManager.swift; sourceTree = "<group>"; };
EC47F9D72A34C62000CA3A3F /* Manager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Manager.swift; sourceTree = "<group>"; };
EC47F9D92A34C73B00CA3A3F /* Stub.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Stub.swift; sourceTree = "<group>"; }; EC47F9D92A34C73B00CA3A3F /* Stub.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Stub.swift; sourceTree = "<group>"; };
EC47F9DB2A34D36200CA3A3F /* EditableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditableView.swift; sourceTree = "<group>"; };
EC47F9DF2A34F00C00CA3A3F /* MatiereEditView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MatiereEditView.swift; sourceTree = "<group>"; };
EC47F9E12A35E89400CA3A3F /* UeeVm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UeeVm.swift; sourceTree = "<group>"; }; EC47F9E12A35E89400CA3A3F /* UeeVm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UeeVm.swift; sourceTree = "<group>"; };
EC47F9E32A35EF1800CA3A3F /* ArrayExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayExtension.swift; sourceTree = "<group>"; }; EC47F9E32A35EF1800CA3A3F /* ArrayExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayExtension.swift; sourceTree = "<group>"; };
EC47F9E52A3633DA00CA3A3F /* ManagerVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ManagerVM.swift; sourceTree = "<group>"; }; EC47F9E52A3633DA00CA3A3F /* DataManagerVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataManagerVM.swift; sourceTree = "<group>"; };
EC7725422A1F80980075CBBF /* BlocView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlocView.swift; sourceTree = "<group>"; }; EC7692E72A4565ED00F9F644 /* UeCollection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UeCollection.swift; sourceTree = "<group>"; };
EC7692E92A45660500F9F644 /* MatiereCollection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MatiereCollection.swift; sourceTree = "<group>"; };
EC7692EB2A45661C00F9F644 /* BlocCollection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlocCollection.swift; sourceTree = "<group>"; };
EC7692ED2A45667700F9F644 /* CollectionVMUe.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollectionVMUe.swift; sourceTree = "<group>"; };
EC7692EF2A45669000F9F644 /* MatiereCollectionVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MatiereCollectionVM.swift; sourceTree = "<group>"; };
EC7692F12A4566CF00F9F644 /* BlocCollectionVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlocCollectionVM.swift; sourceTree = "<group>"; };
EC7692F32A45680700F9F644 /* Home.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Home.swift; sourceTree = "<group>"; };
EC7692F52A45683100F9F644 /* Uee.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Uee.swift; sourceTree = "<group>"; };
EC7692F72A45685200F9F644 /* MatiereUnq.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MatiereUnq.swift; sourceTree = "<group>"; };
EC7692F92A45687000F9F644 /* edit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = edit.swift; sourceTree = "<group>"; };
EC7692FB2A45689000F9F644 /* UeCapsule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UeCapsule.swift; sourceTree = "<group>"; };
EC7692FD2A4568A900F9F644 /* MatiereCapsule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MatiereCapsule.swift; sourceTree = "<group>"; };
EC7692FF2A4568BD00F9F644 /* EditSheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditSheet.swift; sourceTree = "<group>"; };
EC7693012A4568D700F9F644 /* MatiereEditView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MatiereEditView.swift; sourceTree = "<group>"; };
EC7693032A4568F300F9F644 /* BlockItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlockItem.swift; sourceTree = "<group>"; };
EC7693052A45691900F9F644 /* AddSheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddSheet.swift; sourceTree = "<group>"; };
EC7693072A456A2400F9F644 /* NoteColor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NoteColor.swift; sourceTree = "<group>"; };
EC7693092A456B6B00F9F644 /* Block.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Block.swift; sourceTree = "<group>"; };
EC7725442A1F814A0075CBBF /* UeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UeView.swift; sourceTree = "<group>"; }; EC7725442A1F814A0075CBBF /* UeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UeView.swift; sourceTree = "<group>"; };
EC7725482A1F8DFE0075CBBF /* MatiereView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MatiereView.swift; sourceTree = "<group>"; };
EC77254A2A1F8E770075CBBF /* VuePrincipale.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VuePrincipale.swift; sourceTree = "<group>"; };
EC77254C2A1F8EE90075CBBF /* ListUe.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListUe.swift; sourceTree = "<group>"; };
EC7725532A1F90CF0075CBBF /* BlocModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlocModel.swift; sourceTree = "<group>"; }; EC7725532A1F90CF0075CBBF /* BlocModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlocModel.swift; sourceTree = "<group>"; };
EC7725552A1F90FD0075CBBF /* UE.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UE.swift; sourceTree = "<group>"; }; EC7725552A1F90FD0075CBBF /* UE.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UE.swift; sourceTree = "<group>"; };
EC7725572A1F91300075CBBF /* Matiere.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Matiere.swift; sourceTree = "<group>"; }; EC7725572A1F91300075CBBF /* Matiere.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Matiere.swift; sourceTree = "<group>"; };
@ -157,6 +171,7 @@
EC1A52612A1CE12900F8CC93 /* SwiftMvvmApp.swift */, EC1A52612A1CE12900F8CC93 /* SwiftMvvmApp.swift */,
EC1A52632A1CE12900F8CC93 /* ContentView.swift */, EC1A52632A1CE12900F8CC93 /* ContentView.swift */,
EC1A52652A1CE12A00F8CC93 /* Assets.xcassets */, EC1A52652A1CE12A00F8CC93 /* Assets.xcassets */,
EC7693072A456A2400F9F644 /* NoteColor.swift */,
EC1A52672A1CE12A00F8CC93 /* Preview Content */, EC1A52672A1CE12A00F8CC93 /* Preview Content */,
); );
path = SwiftMvvm; path = SwiftMvvm;
@ -191,7 +206,6 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
EC47F9D52A34C50C00CA3A3F /* DataManager.swift */, EC47F9D52A34C50C00CA3A3F /* DataManager.swift */,
EC47F9D72A34C62000CA3A3F /* Manager.swift */,
EC47F9D92A34C73B00CA3A3F /* Stub.swift */, EC47F9D92A34C73B00CA3A3F /* Stub.swift */,
); );
path = Manager; path = Manager;
@ -204,6 +218,9 @@
EC7725552A1F90FD0075CBBF /* UE.swift */, EC7725552A1F90FD0075CBBF /* UE.swift */,
EC7725572A1F91300075CBBF /* Matiere.swift */, EC7725572A1F91300075CBBF /* Matiere.swift */,
EC77255A2A1F92EC0075CBBF /* Maquette.swift */, EC77255A2A1F92EC0075CBBF /* Maquette.swift */,
EC7692E72A4565ED00F9F644 /* UeCollection.swift */,
EC7692E92A45660500F9F644 /* MatiereCollection.swift */,
EC7692EB2A45661C00F9F644 /* BlocCollection.swift */,
); );
path = Model; path = Model;
sourceTree = "<group>"; sourceTree = "<group>";
@ -211,17 +228,18 @@
EC7725592A1F91530075CBBF /* Vue */ = { EC7725592A1F91530075CBBF /* Vue */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
EC77254A2A1F8E770075CBBF /* VuePrincipale.swift */,
EC77254C2A1F8EE90075CBBF /* ListUe.swift */,
EC7725482A1F8DFE0075CBBF /* MatiereView.swift */,
EC1A528B2A1CE77F00F8CC93 /* HomeView.swift */,
EC7725442A1F814A0075CBBF /* UeView.swift */, EC7725442A1F814A0075CBBF /* UeView.swift */,
EC7725422A1F80980075CBBF /* BlocView.swift */, EC7692F32A45680700F9F644 /* Home.swift */,
EC2E21F32A25E9FA00DED570 /* MatiereUniq.swift */, EC7692F52A45683100F9F644 /* Uee.swift */,
EC2E21F72A25FCAA00DED570 /* stbmat.swift */, EC7692F72A45685200F9F644 /* MatiereUnq.swift */,
EC369C202A325FB5005EE7C8 /* Note.swift */, EC7692F92A45687000F9F644 /* edit.swift */,
EC47F9DB2A34D36200CA3A3F /* EditableView.swift */, EC7692FB2A45689000F9F644 /* UeCapsule.swift */,
EC47F9DF2A34F00C00CA3A3F /* MatiereEditView.swift */, EC7692FD2A4568A900F9F644 /* MatiereCapsule.swift */,
EC7692FF2A4568BD00F9F644 /* EditSheet.swift */,
EC7693012A4568D700F9F644 /* MatiereEditView.swift */,
EC7693032A4568F300F9F644 /* BlockItem.swift */,
EC7693052A45691900F9F644 /* AddSheet.swift */,
EC7693092A456B6B00F9F644 /* Block.swift */,
); );
path = Vue; path = Vue;
sourceTree = "<group>"; sourceTree = "<group>";
@ -233,7 +251,10 @@
ECF5E2752A23104800A2E9CA /* MatiereVm.swift */, ECF5E2752A23104800A2E9CA /* MatiereVm.swift */,
EC47F9E12A35E89400CA3A3F /* UeeVm.swift */, EC47F9E12A35E89400CA3A3F /* UeeVm.swift */,
EC47F9E32A35EF1800CA3A3F /* ArrayExtension.swift */, EC47F9E32A35EF1800CA3A3F /* ArrayExtension.swift */,
EC47F9E52A3633DA00CA3A3F /* ManagerVM.swift */, EC47F9E52A3633DA00CA3A3F /* DataManagerVM.swift */,
EC7692ED2A45667700F9F644 /* CollectionVMUe.swift */,
EC7692EF2A45669000F9F644 /* MatiereCollectionVM.swift */,
EC7692F12A4566CF00F9F644 /* BlocCollectionVM.swift */,
); );
path = ViewModel; path = ViewModel;
sourceTree = "<group>"; sourceTree = "<group>";
@ -386,35 +407,42 @@
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
EC7725432A1F80980075CBBF /* BlocView.swift in Sources */,
EC77254D2A1F8EE90075CBBF /* ListUe.swift in Sources */,
EC47F9E22A35E89400CA3A3F /* UeeVm.swift in Sources */, EC47F9E22A35E89400CA3A3F /* UeeVm.swift in Sources */,
EC369C212A325FB5005EE7C8 /* Note.swift in Sources */, EC7693042A4568F300F9F644 /* BlockItem.swift in Sources */,
EC7693022A4568D700F9F644 /* MatiereEditView.swift in Sources */,
ECF5E2722A23102800A2E9CA /* BlocVm.swift in Sources */, ECF5E2722A23102800A2E9CA /* BlocVm.swift in Sources */,
EC7692E82A4565ED00F9F644 /* UeCollection.swift in Sources */,
EC7693002A4568BD00F9F644 /* EditSheet.swift in Sources */,
EC7693082A456A2400F9F644 /* NoteColor.swift in Sources */,
EC7692F82A45685200F9F644 /* MatiereUnq.swift in Sources */,
EC7692EA2A45660500F9F644 /* MatiereCollection.swift in Sources */,
EC47F9D62A34C50C00CA3A3F /* DataManager.swift in Sources */, EC47F9D62A34C50C00CA3A3F /* DataManager.swift in Sources */,
EC47F9DC2A34D36200CA3A3F /* EditableView.swift in Sources */, EC76930A2A456B6B00F9F644 /* Block.swift in Sources */,
EC1A528C2A1CE77F00F8CC93 /* HomeView.swift in Sources */,
EC1A52642A1CE12900F8CC93 /* ContentView.swift in Sources */, EC1A52642A1CE12900F8CC93 /* ContentView.swift in Sources */,
EC7725562A1F90FD0075CBBF /* UE.swift in Sources */, EC7725562A1F90FD0075CBBF /* UE.swift in Sources */,
EC2E21F82A25FCAA00DED570 /* stbmat.swift in Sources */,
EC7725542A1F90CF0075CBBF /* BlocModel.swift in Sources */, EC7725542A1F90CF0075CBBF /* BlocModel.swift in Sources */,
EC7725452A1F814A0075CBBF /* UeView.swift in Sources */, EC7725452A1F814A0075CBBF /* UeView.swift in Sources */,
EC9D96642A33519800513D62 /* StubMat.swift in Sources */, EC9D96642A33519800513D62 /* StubMat.swift in Sources */,
EC77255B2A1F92EC0075CBBF /* Maquette.swift in Sources */, EC77255B2A1F92EC0075CBBF /* Maquette.swift in Sources */,
EC47F9D82A34C62000CA3A3F /* Manager.swift in Sources */, EC7692FC2A45689000F9F644 /* UeCapsule.swift in Sources */,
EC2E21F42A25E9FA00DED570 /* MatiereUniq.swift in Sources */, EC7692FE2A4568A900F9F644 /* MatiereCapsule.swift in Sources */,
EC77254B2A1F8E770075CBBF /* VuePrincipale.swift in Sources */,
ECF5E27A2A23177500A2E9CA /* UeStruct.swift in Sources */, ECF5E27A2A23177500A2E9CA /* UeStruct.swift in Sources */,
EC7692FA2A45687000F9F644 /* edit.swift in Sources */,
EC7725652A2095620075CBBF /* StructBlocs.swift in Sources */, EC7725652A2095620075CBBF /* StructBlocs.swift in Sources */,
EC1A52622A1CE12900F8CC93 /* SwiftMvvmApp.swift in Sources */, EC1A52622A1CE12900F8CC93 /* SwiftMvvmApp.swift in Sources */,
EC47F9E62A3633DA00CA3A3F /* ManagerVM.swift in Sources */, EC47F9E62A3633DA00CA3A3F /* DataManagerVM.swift in Sources */,
EC7725492A1F8DFE0075CBBF /* MatiereView.swift in Sources */, EC7693062A45691900F9F644 /* AddSheet.swift in Sources */,
EC7725582A1F91300075CBBF /* Matiere.swift in Sources */, EC7725582A1F91300075CBBF /* Matiere.swift in Sources */,
EC47F9E02A34F00C00CA3A3F /* MatiereEditView.swift in Sources */, EC7692EC2A45661C00F9F644 /* BlocCollection.swift in Sources */,
EC7692F42A45680700F9F644 /* Home.swift in Sources */,
EC7692EE2A45667700F9F644 /* CollectionVMUe.swift in Sources */,
EC47F9E42A35EF1800CA3A3F /* ArrayExtension.swift in Sources */, EC47F9E42A35EF1800CA3A3F /* ArrayExtension.swift in Sources */,
EC7692F62A45683100F9F644 /* Uee.swift in Sources */,
EC7692F02A45669000F9F644 /* MatiereCollectionVM.swift in Sources */,
ECF5E2762A23104800A2E9CA /* MatiereVm.swift in Sources */, ECF5E2762A23104800A2E9CA /* MatiereVm.swift in Sources */,
EC9D96622A334F9A00513D62 /* StubData.swift in Sources */, EC9D96622A334F9A00513D62 /* StubData.swift in Sources */,
EC47F9DA2A34C73B00CA3A3F /* Stub.swift in Sources */, EC47F9DA2A34C73B00CA3A3F /* Stub.swift in Sources */,
EC7692F22A4566CF00F9F644 /* BlocCollectionVM.swift in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };

@ -5,7 +5,7 @@
// Created by etudiant on 23/05/2023. // Created by etudiant on 23/05/2023.
// //
import SwiftUI /*import SwiftUI
struct ContentView: View { struct ContentView: View {
var body: some View { var body: some View {
@ -23,4 +23,4 @@ struct ContentView_Previews: PreviewProvider {
static var previews: some View { static var previews: some View {
ContentView() ContentView()
} }
} }*/

@ -9,6 +9,7 @@
import Foundation import Foundation
public protocol DataManager { public protocol DataManager {
func loadUes() -> [UE] func load() -> [Ue]
func save(ues: [UE]) func loadUeStage_Proj() -> [Ue]
func save(ues: [Ue])
} }

@ -1,29 +0,0 @@
//
// Manager.swift
// SwiftMvvm
//
// Created by etudiant on 10/06/2023.
//
import Foundation
public struct Manager {
let dataManager: DataManager
public var ues: [UE] = []
public init(withDataManager dataManager: DataManager){
self.dataManager = dataManager
}
public mutating func loadUes() {
self.ues.removeAll()
for ue in self.dataManager.loadUes() {
self.ues.append(ue)
}
}
public func saveUes() {
self.dataManager.save(ues:self.ues)
}
}

@ -6,72 +6,103 @@
// //
import Foundation import Foundation
public struct DataStub : DataManager{
public struct Stub : DataManager { public func load() -> [Ue] {
return [
Ue( nom: "Génie Logiciel", matieres: loadMartiereUE1(),coef: 6),
Ue( nom: "Systèmes et réseaux", matieres: loadMartiereUE2(), coef: 6),
Ue( nom: "Insertion Professionnelle", matieres: loadMartiereUE3(),coef: 6),
Ue( nom: "Technologies Mobiles 1", matieres: loadMartiereUE4(),coef:9),
Ue( nom: "Technologies Mobiles 2", matieres: loadMartiereUE5(),coef:9),
]
}
public func save(ues: [Ue]) {
}
var ue_proj : Ue {
return Ue( nom: "Projet", matieres: loadMartiereUE6(),coef: 9)}
var ue_stage : Ue {
return Ue( nom: "Stage", matieres: loadMartiereUE7(),coef: 15)
}
var ue_projvm : UeVM {
return UeVM(withUe: ue_proj)}
var ue_stagevm : UeVM {
return UeVM(withUe: ue_stage)
}
public init(){} public init(){}
public func loadUes() -> [UE] {
var ues: [UE] = [] public func loadUeStage_Proj()->[Ue]{
return [
ue_proj,
/* UE 1 : Génie Logiciel (coeff. 6) */ ue_stage
ues.append(UE(id: UUID(), coefficient: 6, moyenne: 0.0, nom: "Systèmes et réseaux ",
listeMatiere: [ ]
Matiere(id: UUID(), nom: "Internet des Objets", coefficient: 4, note: 0.0), }
Matiere(id: UUID(), nom: "Réseaux", coefficient: 4, note: 0.0),
Matiere(id: UUID(), nom: "Services Mobiles", coefficient: 4, note: 0.0), func loadMartiereUE1()->[Matiere]{
Matiere(id: UUID(), nom: "Système ", coefficient: 5, note: 0.0), return [
])) Matiere( name: "Processus de développement", moy: 12, coef: 4),
ues.append(UE(id: UUID(), coefficient: 6, moyenne: 0.0, nom: "Génie Logiciel", Matiere( name: "Programmation Objets", moy: 12, coef: 9),
listeMatiere: [ Matiere( name: "Qualité de développpement", moy: 12, coef: 5),
Matiere(id: UUID(), nom: "Processus de développement", coefficient: 4, note: 0.0), Matiere( name: "Remise à niveau objets", moy: 12, coef: 4)
Matiere(id: UUID(), nom: "Programmation Objets", coefficient: 9, note: 0.0), ]
Matiere(id: UUID(), nom: "Qualité de développpement", coefficient: 5, note: 0.0), }
Matiere(id: UUID(), nom: "Remise à niveau objets", coefficient: 4, note: 0.0),
])) func loadMartiereUE2()->[Matiere]{
ues.append(UE(id: UUID(), coefficient: 6, moyenne: 0.0, nom: "Insertion Professionnelle ", return [
listeMatiere: [ Matiere( name: "Internet des Objets", moy: 8, coef: 4),
Matiere(id: UUID(), nom: "Anglais", coefficient: 5, note: 0.0), Matiere( name: "Réseaux", moy: 7, coef: 4),
Matiere(id: UUID(), nom: "Economie", coefficient: 4, note: 0.0), Matiere( name: "Services Mobiles", moy: 7, coef: 4),
Matiere(id: UUID(), nom: "Gestion", coefficient: 3, note: 0.0), Matiere( name: "Système", moy: 7, coef: 4),
Matiere(id: UUID(), nom: "Communication", coefficient: 4, note: 0.0), ]
])) }
ues.append(UE(id: UUID(), coefficient: 9, moyenne: 0.0, nom: "Technologies Mobiles 1 ",
listeMatiere: [ func loadMartiereUE3()->[Matiere]{
Matiere(id: UUID(), nom: "Android ", coefficient: 6, note: 0.0), return [
Matiere(id: UUID(), nom: "Architecture de projets C# .NET", coefficient: 5, note: 0.0), Matiere( name: "Anglais", moy: 12, coef: 5),
Matiere(id: UUID(), nom: "C++", coefficient: 4, note: 0.0), Matiere( name: "Economie", moy: 12, coef: 4),
Matiere(id: UUID(), nom: "Swift", coefficient: 5, note: 0.0), Matiere( name: "Gestion", moy: 12, coef: 3),
])) Matiere( name: "Communication", moy: 12, coef: 4),
ues.append(UE(id: UUID(), coefficient: 9, moyenne: 0.0, nom: "Technologies Mobiles 2 ", ]
listeMatiere: [ }
Matiere(id: UUID(), nom: "Architecture de projets C# .NET ", coefficient: 4, note: 0.0),
Matiere(id: UUID(), nom: "Client/Serveur", coefficient: 4, note: 0.0), func loadMartiereUE4()->[Matiere]{
Matiere(id: UUID(), nom: "iOS ", coefficient: 5, note: 0.0), return [
Matiere(id: UUID(), nom: "Multiplateformes ", coefficient: 3, note: 0.0), Matiere( name: "Android", moy: 12, coef: 6),
Matiere(id: UUID(), nom: "QT Quick ", coefficient: 5, note: 0.0), Matiere( name: "Architecture de projets C# .NET (1)", moy: 12, coef: 5),
Matiere(id: UUID(), nom: "Xamarin ", coefficient: 5, note: 0.0), Matiere( name: "C++", moy: 12, coef: 4),
])) Matiere( name: "Swift", moy: 12, coef: 5),
ues.append(UE(id: UUID(), coefficient: 9, moyenne: 0.0, nom: "Projet ", ]
listeMatiere: [ }
Matiere(id: UUID(), nom: "Projet ", coefficient: 1, note: 0.0),
func loadMartiereUE5()->[Matiere]{
])) return [
ues.append(UE(id: UUID(), coefficient: 15, moyenne: 0.0, nom: "Stage ", Matiere( name: "Architecture de projets C# .NET (2)", moy: 12, coef: 4),
listeMatiere: [ Matiere( name: "Client/Serveur", moy: 12, coef: 4),
Matiere(id: UUID(), nom: "Stage ", coefficient: 1, note: 0.0), Matiere( name: "iOS", moy: 12, coef: 5),
Matiere( name: "Multiplateformes", moy: 12, coef: 3),
])) Matiere( name: "QT Quick", moy: 12, coef: 5),
Matiere( name: "Xamarin", moy: 12, coef: 5),
]
}
func loadMartiereUE6()->[Matiere]{
return ues return [
Matiere( name: "Projet", moy: 12, coef: 9)
]
} }
public func save(ues: [UE]) { func loadMartiereUE7()->[Matiere]{
return [
Matiere( name: "Stage", moy: 12, coef: 15)
]
} }
} }

@ -0,0 +1,21 @@
//
// BlocCollection.swift
// SwiftMvvm
//
// Created by etudiant on 23/06/2023.
//
import Foundation
struct BlocCollection : Identifiable, Equatable {
var id : UUID
var blocs: [Bloc]
init(blocs: [Bloc]) {
self.id = UUID()
self.blocs = blocs
}
}

@ -5,26 +5,25 @@
// Created by etudiant on 25/05/2023. // Created by etudiant on 25/05/2023.
// //
import Foundation import Foundation
struct BlocModel: Identifiable ,Equatable { public class Bloc : Identifiable, Equatable{
static func == (lhs: BlocModel, rhs: BlocModel) -> Bool { public static func == (lhs: Bloc, rhs: Bloc) -> Bool {
lhs.id == rhs.id lhs.id == rhs.id
} }
let id = UUID()
var Nombloc: String
var Moyenneg: Double
var listeUE: [UE]
public init(Nombloc: String, Moyenneg: Double, listeUE: [UE]) {
self.Nombloc = Nombloc
self.Moyenneg = Moyenneg
self.listeUE = listeUE
}
//a modifier l calcul de la moyenne
// func MoyenneBloc(bloc: BlocModel) -> Double {
// let sumOfMoyennes = bloc.listeUE.reduce(into: 0.0) { $0 + $1.MoyenneUE }
// let numberOfUEs = Double(bloc.listeUE.count)
// return sumOfMoyennes / numberOfUEs
// }
var nom : String
var isUnique : Bool
public var id : UUID
var ues : [Ue]
var total : Double {
return Double(ues.reduce(0) { $0 + $1.totalMoyenne }) / Double(ues.count)
}
init(nom: String, ues: [Ue], isUq : Bool) {
self.id = UUID()
self.nom = nom
self.ues = ues
self.isUnique = isUq
}
} }

@ -5,7 +5,7 @@
// Created by etudiant on 25/05/2023. // Created by etudiant on 25/05/2023.
// //
import Foundation /*import Foundation
struct Maquette { struct Maquette {
var listeBloc: [BlocModel] var listeBloc: [BlocModel]
var listeUE: [UE] var listeUE: [UE]
@ -14,3 +14,4 @@ struct Maquette {
self.listeUE = listeUE self.listeUE = listeUE
} }
} }
*/

@ -6,19 +6,21 @@
// //
import Foundation import Foundation
public struct Matiere: Identifiable, Equatable {
struct Matiere : Identifiable, Equatable{
public let id: UUID
public var nom: String
public var coefficient: Double
public var note:Double
public init(id: UUID, nom: String, coefficient: Double,note :Double ) {
self.id = id
self.nom = nom
self.coefficient = coefficient
self.note=note
static func == (lhs: Matiere, rhs: Matiere) -> Bool {
lhs.id == rhs.id
}
let id: UUID
var name: String
var moyenne: Float
var coef : Int
init( name: String, moy: Float, coef : Int) {
self.id = UUID()
self.name = name
self.moyenne = moy
self.coef = coef
} }
} }

@ -0,0 +1,24 @@
//
// MatiereCollection.swift
// SwiftMvvm
//
// Created by etudiant on 23/06/2023.
//
import Foundation
struct MatiereCollection : Identifiable, Equatable{
static func == (lhs: MatiereCollection, rhs: MatiereCollection) -> Bool {
lhs.id == rhs.id
}
var id : UUID
var nom: String
var matieres: [Matiere]
init(nom: String, matieres: [Matiere]) {
self.id = UUID()
self.nom = nom
self.matieres = matieres
}
}

@ -6,26 +6,24 @@
// //
import Foundation import Foundation
public struct UE: Identifiable,Equatable { public struct Ue : Identifiable, Equatable {
public static func == (lhs: UE, rhs: UE) -> Bool { public static func == (lhs: Ue, rhs: Ue) -> Bool {
lhs.id == rhs.id lhs.id == rhs.id
} }
public let id: UUID public let id : UUID
var coefficient: Double var nom: String
var moyenne: Double var coef : Int
var nom: String var matieres: [Matiere]
var listeMatiere: [Matiere]
public init(id: UUID, coefficient: Double, moyenne: Double, nom: String, listeMatiere: [Matiere]) { var totalMoyenne: Double {
self.id = id return Double(matieres.reduce(0) { $0 + $1.moyenne }) / Double(matieres.count)
self.coefficient = coefficient
self.moyenne = moyenne
self.nom = nom
self.listeMatiere = listeMatiere
}
func calculerMoyenneUE() -> Double {
let sommeDesNotes = listeMatiere.reduce(into: 0) { $0 + $1.note }
let nombreDeMatieres = Double(listeMatiere.count)
return sommeDesNotes / nombreDeMatieres
} }
init( nom: String, matieres: [Matiere], coef : Int) {
self.id = UUID()
self.nom = nom
self.matieres = matieres
self.coef = coef
}
} }

@ -0,0 +1,25 @@
//
// UeCollection.swift
// SwiftMvvm
//
// Created by etudiant on 23/06/2023.
//
import Foundation
struct UeCollection : Identifiable, Equatable {
public static func == (lhs: UeCollection, rhs: UeCollection) -> Bool {
lhs.id == rhs.id
}
var id : UUID
var nom: String
var ues: [Ue]
init(nom: String, ues: [Ue]) {
self.id = UUID()
self.nom = nom
self.ues = ues
}
}

@ -0,0 +1,13 @@
//
// NoteColor.swift
// SwiftMvvm
//
// Created by etudiant on 23/06/2023.
//
import Foundation
import Foundation
import SwiftUI
public struct NoteColor{
public let ue_back = Color("background_UE")
}

@ -5,7 +5,7 @@
// Created by etudiant on 26/05/2023. // Created by etudiant on 26/05/2023.
// //
import Foundation /*import Foundation
extension BlocModel { extension BlocModel {
struct Data: Identifiable { struct Data: Identifiable {
let id = UUID() let id = UUID()
@ -22,5 +22,5 @@ extension BlocModel {
} }
} }
*/

@ -7,7 +7,7 @@
import Foundation import Foundation
extension UE { extension UeView {
struct Data: Identifiable { struct Data: Identifiable {
let id = UUID() let id = UUID()
var coefficient: Double var coefficient: Double

@ -5,7 +5,7 @@
// Created by etudiant on 09/06/2023. // Created by etudiant on 09/06/2023.
// //
import Foundation /*import Foundation
import SwiftUI import SwiftUI
let stubUES: [UE] = [ let stubUES: [UE] = [
@ -16,5 +16,5 @@ let stubUES: [UE] = [
UE(id: UUID(), coefficient: 9, moyenne: 13.5, nom: "UE5 : Technologies Mobiles 2", listeMatiere: []), UE(id: UUID(), coefficient: 9, moyenne: 13.5, nom: "UE5 : Technologies Mobiles 2", listeMatiere: []),
UE(id: UUID(), coefficient: 9, moyenne: 11.0, nom: "UE6 : Projet", listeMatiere: []), UE(id: UUID(), coefficient: 9, moyenne: 11.0, nom: "UE6 : Projet", listeMatiere: []),
UE(id: UUID(), coefficient: 9, moyenne: 15.0, nom: "UE7 : ÉconoStagemie", listeMatiere: []) UE(id: UUID(), coefficient: 9, moyenne: 15.0, nom: "UE7 : ÉconoStagemie", listeMatiere: [])
] ]*/

@ -5,10 +5,11 @@
// Created by etudiant on 09/06/2023. // Created by etudiant on 09/06/2023.
// //
import Foundation /*import Foundation
import SwiftUI import SwiftUI
let stubMatieres: [Matiere] = [ let stubMatieres: [Matiere] = [
Matiere(id: UUID(), nom: "Mathématiques", coefficient: 2.0, note: 15.0), Matiere(id: UUID(), nom: "Mathématiques", coefficient: 2.0, note: 15.0),
Matiere(id: UUID(), nom: "Physique", coefficient: 1.5, note: 12.0), Matiere(id: UUID(), nom: "Physique", coefficient: 1.5, note: 12.0),
Matiere(id: UUID(), nom: "Chimie", coefficient: 1.0, note: 10.5) Matiere(id: UUID(), nom: "Chimie", coefficient: 1.0, note: 10.5)
] ]
*/

@ -5,13 +5,27 @@
// Created by etudiant on 23/05/2023. // Created by etudiant on 23/05/2023.
// //
/*struct SwiftMvvmApp: App {
var body: some Scene {
WindowGroup {
VuePrincipale()
}
}
}*/
import SwiftUI import SwiftUI
@main @main
struct SwiftMvvmApp: App { struct NoteApp: App {
var blocs = [
BlocVM(withBloc: Bloc(nom: "Total", ues: DataStub().load(),isUq: false)),
BlocVM(withBloc: Bloc(nom: "Projet/Stage", ues: DataStub().loadUeStage_Proj(), isUq: true))
]
var body: some Scene { var body: some Scene {
WindowGroup { WindowGroup {
VuePrincipale() Home(manager: ManagerVM( withBlocs: blocs
))
} }
} }
} }

@ -0,0 +1,47 @@
//
// BlocCollectionVM.swift
// SwiftMvvm
//
// Created by etudiant on 23/06/2023.
//
import Foundation
class BlocCollectionVM : ObservableObject,Identifiable,Equatable {
static func == (lhs: BlocCollectionVM, rhs: BlocCollectionVM) -> Bool {
lhs.id == rhs.id
}
public var id: UUID { model.id }
@Published var model : BlocCollection = BlocCollection( blocs: []){
didSet{
if !self.model.blocs.compare(to: self.someBlocVM.map({$0.model})){
self.someBlocVM = self.model.blocs.map({BlocVM(withBloc: $0)})
}
}
}
@Published var someBlocVM: [BlocVM] = [] {
didSet {
let someModelBlocs = self.someBlocVM.map({$0.model})
if !self.model.blocs.compare(to: someModelBlocs) {
self.model.blocs = someBlocVM.map({$0.model})
}
}
}
init(withbloc blocs : BlocCollection) {
self.model = blocs
}
}

@ -8,69 +8,119 @@
// BlocVM.swift // BlocVM.swift
import Foundation import Foundation
class BlocVM : ObservableObject, Identifiable, Equatable, Hashable {
static func == (lhs: BlocVM, rhs: BlocVM) -> Bool {
lhs.id == rhs.id
}
func hash(into hasher: inout Hasher) {
hasher.combine(self.nom)
hasher.combine(self.totalMoyenne)
}
func onNotifyChanged(source:UeVM){
if let index = self.model.ues.firstIndex(where: {$0 == source.model}) {
self.model.ues[index] = source.model
}
self.objectWillChange.send()
}
private var notificationFuncs: [AnyHashable:(BlocVM) -> ()] = [:]
public func subscribe(with subscriber: AnyHashable, andWithFunction function:@escaping (BlocVM) -> ()) {
notificationFuncs[subscriber] = function
}
public func unsubscribe(with subscriber: AnyHashable) {
notificationFuncs.removeValue(forKey: subscriber)
}
private func onNotifyChanged(){
for f in notificationFuncs.values {
print("moi")
f(self)
}
}
@Published var totalMoyenne: Double = 0.0 {
didSet{
let moy = updateTotalMoyenne()
print("Moy =\(moy)")
if moy != self.totalMoyenne {
self.totalMoyenne = moy
}
self.onNotifyChanged()
}
}
@Published var isUnique : Bool = false {
didSet{
if self.isUnique != self.model.isUnique {
self.model.isUnique = self.isUnique
}
}
}
public func updateTotalMoyenne()->Double {
/* let id = UUID() let totalMoyenn = self.someUesVM.reduce(0.0) { $0 + Double($1.totalMoyenne) * Double($1.coef) }
var Nombloc: String let totalCoef = self.someUesVM.reduce(0.0) { $0 + Double($1.coef) }
var Moyenneg: Double
var listeUE: [UE]*/ print("bloc")
print( totalMoyenn / totalCoef)
return totalMoyenn / totalCoef
class BlocVm : ObservableObject ,Equatable{
static func == (lhs: BlocVm, rhs: BlocVm) -> Bool {
lhs.id == rhs.id
} }
// dans le model on met à jour les donnes du vue model les proprietes à présenter à la vue @Published var model : Bloc = Bloc(nom: "Total", ues: DataStub().load(), isUq: false) {
@Published var model: BlocModel = BlocModel(Nombloc: "", Moyenneg: 17, listeUE: [])
{ willSet(newValue) {
if !self.someUesVM.map({$0.model}).compare(to: newValue.ues){
self.someUesVM.forEach { uevm in
uevm.unsubscribe(with: self)
}
}
}
didSet{ didSet{
if self.model.nom != self.nom {
self.nom = self.model.nom
}
if self.model.Nombloc != self.Nombloc { if !self.model.ues.compare(to: self.someUesVM.map({$0.model})){
self.Nombloc = self.model.Nombloc self.someUesVM = self.model.ues.map({UeVM(withUe: $0)})
self.someUesVM.forEach { uevm in
uevm.subscribe(with: self, andWithFunction: onNotifyChanged(source:))
}
} }
if self.model.Moyenneg != self.Moyenneg { if self.model.isUnique != self.isUnique {
self.Moyenneg = self.model.Moyenneg self.isUnique = self.model.isUnique
} }
if !self.model.listeUE.compare(to: self.someUeVM.map({$0.model})){
self.someUeVM = self.model.listeUE.map({UeVm(withModel: $0)}) let moy = updateTotalMoyenne()
} if moy != self.totalMoyenne {
self.totalMoyenne = moy
}
self.onNotifyChanged()
} }
} }
init(withBloc blc : Bloc) {
self.model = blc
}
public var id: UUID { model.id } public var id: UUID { model.id }
@Published
var Nombloc: String = "" {
didSet {
if self.model.Nombloc != self.Nombloc {
self.model.Nombloc = self.Nombloc
}
}
}
@Published @Published
var Moyenneg : Double = 0 { var nom: String = "" {
didSet { didSet {
if self.model.Moyenneg != self.Moyenneg { if self.model.nom != self.nom {
self.model.Moyenneg = self.Moyenneg self.model.nom = self.nom
} }
} }
} }
//collection on met a jour le Ue avec l dernier @Published var someUesVM: [UeVM] = [] {
@Published var someUeVM: [UeVm] = [] { didSet {
didSet { let someModelue = self.someUesVM.map({$0.model})
let someModelUe = self.someUeVM.map({$0.model}) if !self.model.ues.compare(to: someModelue){
if !self.model.listeUE.compare(to: someModelUe){ self.model.ues = someModelue.map({$0})
self.model.listeUE = someUeVM.map({$0.model})
}
} }
} }
init(withModel BlocModel: BlocModel) {
model = BlocModel
} }
} }

@ -0,0 +1,59 @@
//
// CollectionVMUe.swift
// SwiftMvvm
//
// Created by etudiant on 23/06/2023.
//
import Foundation
class CollectionVMUe : ObservableObject,Identifiable,Equatable {
static func == (lhs: CollectionVMUe, rhs: CollectionVMUe) -> Bool {
lhs.id == rhs.id
}
public var id: UUID { model.id }
@Published var model : UeCollection = UeCollection(nom: "", ues: []){
didSet{
if self.model.nom != self.nom {
self.nom = self.model.nom
}
if !self.model.ues.compare(to: self.someUesVM.map({$0.model})){
self.someUesVM = self.model.ues.map({UeVM(withUe: $0)})
}
}
}
@Published var nom: String = "" {
didSet {
if self.model.nom != self.nom {
self.model.nom = self.nom
}
}
}
@Published var someUesVM: [UeVM] = [] {
didSet {
let someModelUe = self.someUesVM.map({$0.model})
if !self.model.ues.compare(to: someModelUe) {
self.model.ues = someUesVM.map({$0.model})
}
}
}
init(withUe ues : UeCollection) {
self.model = ues
}
}

@ -0,0 +1,44 @@
//
// ManagerVM.swift
// SwiftMvvm
//
// Created by etudiant on 11/06/2023.
//
import Foundation
class ManagerVM: ObservableObject, Hashable {
static func == (lhs: ManagerVM, rhs: ManagerVM) -> Bool {
lhs.blocs.compare(to: rhs.blocs)
}
@Published var blocs: [BlocVM]
// abonnée
func hash(into hasher: inout Hasher) {
hasher.combine("manager")
}
func onNotifyChanged(source:BlocVM){
self.objectWillChange.send()
}
public init(withBloc blocs: [Bloc]){
self.blocs = blocs.map({BlocVM(withBloc: $0)})
self.blocs.forEach { blocvm in
blocvm.subscribe(with: self, andWithFunction: onNotifyChanged(source:))
}
}
var total : Double {
return Double(blocs.reduce(0) { $0 + $1.totalMoyenne }) / Double(blocs.count)
}
public init(withBlocs blocs: [BlocVM]){
self.blocs = blocs
self.blocs.forEach { blocvm in
blocvm.subscribe(with: self, andWithFunction: onNotifyChanged(source:))
}
}
}

@ -1,21 +0,0 @@
//
// ManagerVM.swift
// SwiftMvvm
//
// Created by etudiant on 11/06/2023.
//
import Foundation
//pouvoir les utiliser dans la vue
class ManagerVM: ObservableObject {
@Published var blocs: [BlocVm] = []
public init(withBeds blocs: [BlocModel]){
self.blocs = blocs.map({BlocVm(withModel: $0)})
}
public init(withBeds blocs: [BlocVm]){
self.blocs = blocs
}
}

@ -0,0 +1,66 @@
//
// MatiereCollectionVM.swift
// SwiftMvvm
//
// Created by etudiant on 23/06/2023.
//
import Foundation
class MatiereCollectionVM : ObservableObject,Identifiable,Equatable {
static func == (lhs: MatiereCollectionVM, rhs: MatiereCollectionVM) -> Bool {
lhs.id == rhs.id
}
public var id: UUID { model.id }
/*
var id : UUID
var nom: String
var matieres: [Matiere]
*/
@Published var model : MatiereCollection = MatiereCollection(nom: "", matieres: []){
didSet{
if self.model.nom != self.nom {
self.nom = self.model.nom
}
if !self.model.matieres.compare(to: self.someMatieresVM.map({$0.model})){
self.someMatieresVM = self.model.matieres.map({MatiereVM(withMat: $0)})
}
}
}
@Published var nom: String = "" {
didSet {
if self.model.nom != self.nom {
self.model.nom = self.nom
}
}
}
@Published var someMatieresVM: [MatiereVM] = [] {
didSet {
let someModelMatiere = self.someMatieresVM.map({$0.model})
if !self.model.matieres.compare(to: someModelMatiere){
self.model.matieres = someMatieresVM.map({$0.model})
}
print("vjgjjh")
}
}
init(withMat matieres : MatiereCollection) {
self.model = matieres
}
}

@ -7,64 +7,99 @@
import Foundation import Foundation
class MatiereVm : ObservableObject ,Identifiable {
// dans le model on met à kjour les donnes du vue model les proprietes à présenter à la vue class MatiereVM : ObservableObject, Identifiable, Equatable {
//on vérifie que someNounourscollection de Nounoursdu modèle est différent du someNounoursVMcollection de NounoursVM private var notificationFuncs: [AnyHashable:(MatiereVM) -> ()] = [:]
@Published var model: Matiere = Matiere(id: UUID(), nom: "Ma mat", coefficient: 2, note: 12) { public func subscribe(with subscriber: AnyHashable, andWithFunction function:@escaping (MatiereVM) -> ()) {
didSet{ notificationFuncs[subscriber] = function
}
if self.model.nom != self.nom {
self.nom = self.model.nom public func unsubscribe(with subscriber: AnyHashable) {
} notificationFuncs.removeValue(forKey: subscriber)
}
if self.model.coefficient != self.coefficient { func notifyChanged(){
self.coefficient = self.model.coefficient for f in notificationFuncs.values {
} f(self)
if self.model.note != self.note
{
self.note = self.model.note
} }
} }
static func == (lhs: MatiereVM, rhs: MatiereVM) -> Bool {
lhs.id == rhs.id
} }
/*
public let id: UUID
public var nom: String
public var coefficient: Double
public var note:Double
*/
public var id: UUID { model.id }
@Published public var id: UUID { model.id }
var nom: String = "" { @Published var model : Matiere = Matiere(name: "", moy: 0, coef: 0)
didSet { {
if self.model.nom != self.nom {
self.model.nom = self.nom didSet {
if self.name != self.model.name {
self.name = self.model.name
};
if self.moyenne != self.model.moyenne {
self.moyenne = self.model.moyenne
};
if self.coef != self.model.coef {
self.coef = self.model.coef
}
self.notifyChanged()
} }
} }
}
@Published @Published
var coefficient : Double = 0 { var name: String = "" {
didSet { didSet {
if self.model.coefficient != self.coefficient { if self.model.name != self.name {
self.model.coefficient = self.coefficient self.model.name = self.name
} }
} }
} }
@Published @Published
var note : Double = 0 { var moyenne: Float=0 {
didSet { didSet {
if self.model.note != self.note { if self.model.moyenne != self.moyenne {
self.model.note = self.note self.model.moyenne = self.moyenne
} }
} }
} }
init(withModel Matiere: Matiere) { @Published
model = Matiere var coef: Int = 0 {
didSet {
if self.model.coef != self.coef {
self.model.coef = self.coef
}
}
} }
public init(){}
init(withMat mat : Matiere) {
self.model = mat
}
@Published
var isEditing: Bool = false
private var copy: MatiereVM { MatiereVM(withMat: self.model) }
var editedCopy: MatiereVM?
func onEditing(){
editedCopy = self.copy
isEditing = true
}
func onEdited(isCancelled cancel: Bool = false) {
if !cancel {
if let editedCopy = editedCopy {
self.model = editedCopy.model
}
}
editedCopy = nil
isEditing = false
}
} }

@ -12,72 +12,160 @@ import Foundation
var nom: String var nom: String
var listeMatiere: [Matiere] var listeMatiere: [Matiere]
*/ */
class UeVm : ObservableObject,Equatable , Identifiable {
static func == (lhs: UeVm, rhs: UeVm) -> Bool {
class UeVM : ObservableObject, Identifiable, Equatable,Hashable {
static func == (lhs: UeVM, rhs: UeVM) -> Bool {
lhs.id == rhs.id lhs.id == rhs.id
} }
private var notificationFuncs: [AnyHashable:(UeVM) -> ()] = [:]
// dans le model on met à jour les donnes du vue model les proprietes à présenter à la vue func onNotifyChanged(source:MatiereVM){
@Published var model: UE = UE(id: UUID(), coefficient: 2,moyenne: 10,nom: "", listeMatiere: [] ) { if let index = self.model.matieres.firstIndex(where: {$0 == source.model}) {
self.model.matieres[index] = source.model
}
self.objectWillChange.send()
}
func hash(into hasher: inout Hasher) {
hasher.combine(self.nom)
hasher.combine(self.totalMoyenne)
}
public func subscribe(with subscriber: AnyHashable, andWithFunction function:@escaping (UeVM) -> ()) {
notificationFuncs[subscriber] = function
}
public func unsubscribe(with subscriber: AnyHashable) {
notificationFuncs.removeValue(forKey: subscriber)
}
func onNotifyChanged(){
for f in notificationFuncs.values {
f(self)
}
}
@Published var totalMoyenne: Double = 0.0 {
didSet{
let moy = updateTotalMoyenne()
if moy != self.totalMoyenne {
self.totalMoyenne = moy
}
}
}
public func updateTotalMoyenne()->Double {
let totalMoyenne = someMatieresVM.reduce(0.0) { $0 + Double($1.moyenne) * Double($1.coef) }
let totalCoef = someMatieresVM.reduce(0.0) { $0 + Double($1.coef) }
print("ue")
print(self.someMatieresVM.count)
return totalMoyenne / totalCoef
}
init(withUe ue : Ue) {
self.model = ue
}
@Published var model : Ue = DataStub().load()[0]{
willSet(newValue) {
if !self.someMatieresVM.map({$0.model}).compare(to: newValue.matieres){
self.someMatieresVM.forEach { $0.unsubscribe(with: self) }
}
}
didSet{ didSet{
if self.model.nom != self.nom { if self.model.nom != self.nom {
self.nom = self.model.nom self.nom = self.model.nom
} }
if self.model.coef != self.coef {
if self.model.coefficient != self.coefficient { self.coef = self.model.coef
self.coefficient = self.model.coefficient
} }
if self.model.moyenne != self.moyenne if !self.model.matieres.compare(to: self.someMatieresVM.map({$0.model})){
{ self.someMatieresVM = self.model.matieres.map({MatiereVM(withMat: $0)})
self.moyenne = self.model.moyenne self.someMatieresVM.forEach { mvm in
mvm.subscribe(with: self, andWithFunction: onNotifyChanged(source:))
}
} }
if !self.model.listeMatiere.compare(to: self.someMatVM.map({$0.model})){ let moyen = updateTotalMoyenne()
self.someMatVM = self.model.listeMatiere.map({MatiereVm(withModel: $0)}) if moyen != self.totalMoyenne {
} self.totalMoyenne = moyen
}
self.onNotifyChanged()
} }
} }
public var id: UUID { model.id } public var id: UUID { model.id }
@Published @Published
var nom: String = "" { var nom: String = "" {
didSet { didSet {
if self.model.nom != self.nom { if self.model.nom != self.nom {
self.model.nom = self.nom self.model.nom = self.nom
}
} }
} }
}
@Published @Published
var coefficient : Double = 0 { var coef: Int = 0 {
didSet { didSet {
if self.model.coefficient != self.coefficient { if self.model.coef != self.coef {
self.model.coefficient = self.coefficient self.model.coef = self.coef
} }
} }
} }
@Published @Published var someMatieresVM: [MatiereVM] = [] {
var moyenne : Double = 0 {
didSet { didSet {
if self.model.moyenne != self.moyenne { let someModelMatiere = self.someMatieresVM.map({$0.model})
self.model.moyenne = self.moyenne if !self.model.matieres.compare(to: someModelMatiere){
self.model.matieres = someModelMatiere.map({$0})
}
} }
} }
public init (){}
@Published
var isEditing: Bool = false
private var copy: UeVM { UeVM(withUe: self.model) }
var editedCopy: UeVM?
func onEditing(){
editedCopy = self.copy
isEditing = true
} }
/* chaque fois que someNounoursVM est modifié, le bloc didSet vérifie si les modèles qu'il contient sont différents de ceux déjà présents dans self.model.someNounours. Si tel est le cas, il met à jour self.model.someNounours avec les nouveaux modèles.*/ func onEdited(isCancelled cancel: Bool = false) {
@Published var someMatVM: [MatiereVm] = [] { if !cancel {
didSet { if let editedCopy = editedCopy {
let someModelMatier = self.someMatVM.map({$0.model}) self.model = editedCopy.model
if !self.model.listeMatiere.compare(to: someModelMatier){
self.model.listeMatiere = someMatVM.map({$0.model})
}
} }
} }
init(withModel UE: UE) { isEditing = false
model = UE
} }
var addedItem: MatiereVM? = MatiereVM(withMat: Matiere(name: "", moy: 0.0, coef: 1))
@Published
var isAdding: Bool = false
func onAdding() {
addedItem = MatiereVM()
isAdding = true
}
func onAdded(isCancelled cancel:Bool = false) {
if !cancel {
if let addedItem = addedItem {
self.someMatieresVM.append(addedItem)
addedItem.subscribe(with: self, andWithFunction: onNotifyChanged(source:))
}
}
addedItem = nil
isAdding = false
}
func onDeleted(_ matiere:MatiereVM, isCancelled cancel: Bool = false) {
if !cancel {
if self.someMatieresVM.contains(matiere) {
self.someMatieresVM.filter { $0 == matiere }
.forEach { $0.unsubscribe(with: self) }
self.someMatieresVM.removeAll(where: {$0 == matiere})
}
}
}
} }

@ -0,0 +1,33 @@
//
// AddSheet.swift
// SwiftMvvm
//
// Created by etudiant on 23/06/2023.
//
import SwiftUI
struct AddSheet: View {
@ObservedObject var mat : MatiereVM
var body: some View {
VStack{
HStack{
Text("Nom : ")
TextField("Description", text: $mat.name)
}
HStack{
Text("Coef : ")
TextField("Coefficient", value: $mat.coef, format: .number)
}
}
}
}
struct AddSheet_Previews: PreviewProvider {
static var previews: some View {
AddSheet(mat: MatiereVM())
}
}

@ -1,40 +0,0 @@
//
// BlocView.swift
// SwiftMvvm
//
// Created by etudiant on 25/05/2023.
//
import SwiftUI
struct BlocView: View {
var body: some View {
VStack(alignment: .leading) {
Label("Blocs", systemImage: "doc.on.doc.fill")
.font(.title)
Text("Vous devez avoir la moyenne à chacun de ces blocs pour avoir votre diplôme.")
HStack {
Label("Total", systemImage: "doc.on.doc.fill")
Spacer()
Label("11.67", systemImage: "graduationcap.circle.fill")
}
HStack {
Label("Total", systemImage: "doc.on.doc.fill")
Spacer()
Label("11.67", systemImage: "graduationcap.circle.fill")
}
}
.padding()
.background(Color("ListItemBackgroundColor"))
.cornerRadius(12)
}
}
struct BlocView_Previews: PreviewProvider {
static var previews: some View {
BlocView()
}
}

@ -0,0 +1,46 @@
//
// Block.swift
// SwiftMvvm
//
// Created by etudiant on 23/06/2023.
//
import SwiftUI
import SwiftUI
struct Block: View {
@ObservedObject var manager : ManagerVM
var body: some View {
VStack(alignment: .leading) {
HStack {
Image(systemName: "menucard.fill")
Text("Blocs").bold().font(.title)
}
Text("Vous devez avoir la moyenne à chacun de ces blocs pour avoir votre diplôme.").padding(.bottom)
BlockItem(total: .constant( manager.total), name: .constant("Total"))
ForEach(manager.blocs) { item in
if item.isUnique {
BlockItem(total: .constant(item.totalMoyenne), name: .constant(item.nom))
Divider()
}
}
}.padding().background(NoteColor().ue_back).cornerRadius(10)
}
}
struct Block_Previews: PreviewProvider {
static var previews: some View {
let blocs = [
BlocVM(withBloc: Bloc(nom: "Total", ues:DataStub().load(),isUq: false)),
BlocVM(withBloc: Bloc(nom: "Projet", ues: DataStub().loadUeStage_Proj(), isUq: true))]
Block(manager: ManagerVM(withBlocs: blocs) )
}
}

@ -0,0 +1,36 @@
//
// BlockItem.swift
// SwiftMvvm
//
// Created by etudiant on 20/06/2023.
//
import SwiftUI
struct BlockItem: View {
@Binding var total : Double
@Binding var name : String
var body: some View {
HStack(spacing: 15) {
Grid{
GridRow {
Image(systemName: "rectangle.on.rectangle")
Text(self.name).font(.title3)
Text( self.total,format: .number)
Image(systemName: "graduationcap.circle.fill")
}
}
}
}
}
struct BlockItem_Previews: PreviewProvider {
static var previews: some View {
BlockItem(total: .constant( 12.9), name: .constant( "Total"))
}
}

@ -0,0 +1,93 @@
//
// EditSheet.swift
// SwiftMvvm
//
// Created by etudiant on 23/06/2023.
//
import Foundation
import SwiftUI
struct EditSheet : View{
@ObservedObject var ue: UeVM
@Binding var isEditMode: Bool
var body: some View {
NavigationView {
VStack{
Section(header: Text("UE Info").font(.title))
{
VStack{
TextField("Description", text: $ue.nom)
TextField("Coefficient", value: $ue.coef, format: .number)
}
}
Divider()
Section(header: Text("Matieres").font(.title)) {
ForEach(ue.someMatieresVM) { matiere in
HStack{
MatiereEditView(matiere: matiere)
Button(action: {
self.ue.onDeleted(matiere)
}){
Text("Supprimer")
}
}
}
Spacer()
Button(action: {
self.ue.onAdding()
}) {
Text("Ajouter une matiere")
}
}
}.padding().background(NoteColor().ue_back)
}
.navigationBarItems(trailing:
Button(action: {
self.ue.onEdited()
}) {
Text( self.ue.isEditing ? "Done" : "Modifier")
})
// Feuille d'ajout
.sheet(isPresented: $ue.isAdding){
NavigationStack{
AddSheet(mat: self.ue.addedItem ?? MatiereVM())
.toolbar{
ToolbarItem(id: "Ajouter", placement: .confirmationAction){
Button(action: {
self.ue.onAdded()
}){
Text("Add")
}
}
ToolbarItem(id: "cancel", placement: .cancellationAction){
Button(action: {
self.ue.onAdded(isCancelled: true)
}){
Text("Cancel")
}
}
}
.navigationBarTitle("Ajout d'une nouvelle matière")
}
}
}}
struct EditSheet_Previews: PreviewProvider {
static var previews: some View {
let uevm : UeVM = UeVM(withUe: DataStub().ue_proj)
EditSheet(ue: uevm, isEditMode: .constant(true))
}
}

@ -1,79 +0,0 @@
//
// EditableView.swift
// SwiftMvvm
//
// Created by etudiant on 10/06/2023.
//
import SwiftUI
struct EditableView: View {
@ObservedObject var editableUe:UeVm
@State var isEditing: Bool = false
var body: some View {
NavigationStack{
Form{
NavigationLink{
Form{
TextField("", text: $editableUe.nom, prompt: Text("enter the name"))
}
.navigationBarTitleDisplayMode(.inline)
.navigationTitle("Name")
}
label: {
HStack{
Text("Name")
Spacer()
Text(editableUe.nom)
.foregroundColor(.gray)
}
}
NavigationLink{
Form{
TextField("", value: $editableUe.coefficient, format: .number, prompt: Text("enter the COEF"))
}
.navigationBarTitleDisplayMode(.inline)
.navigationTitle("enter the COEFt")
}
label: {
HStack{
Text("enter the COEFt")
Spacer()
Text(String(editableUe.coefficient))
.foregroundColor(.gray)
}
}
NavigationLink{
Form{
TextField("", value: $editableUe.moyenne, format: .number, prompt: Text("enter the NOTE"))
}
.navigationBarTitleDisplayMode(.inline)
.navigationTitle("enter the NOTE")
}
label: {
HStack{
Text("enter the NOTE")
Spacer()
Text(String(editableUe.moyenne))
.foregroundColor(.gray)
}
}
//
}
}
}
}
struct EditableView_Previews: PreviewProvider {
static var previews: some View {
let ueee = Stub().loadUes()[0]
EditableView(editableUe:UeVm(withModel:ueee))
}
}

@ -0,0 +1,59 @@
//
// Home.swift
// SwiftMvvm
//
// Created by etudiant on 23/06/2023.
//
import Foundation
import SwiftUI
struct Home: View {
// @State public var ues = DataStub().load()
@StateObject var manager: ManagerVM
var body: some View {
NavigationView{
VStack(alignment : .leading){
HStack {
Text("Calculette").bold().font(.title)
}
Block(manager: manager )
VStack(alignment : .leading){
HStack(alignment:.bottom){
Image(systemName: "menucard.fill")
Text("UEs").bold().font(.title)
}.padding()
ScrollView{
ForEach(manager.blocs) { item in
ForEach(item.someUesVM) {
ue in
UeView(bloc: item, ue: ue)
}
}
}
}.padding().background(NoteColor().ue_back).cornerRadius(10)
}.padding()
}
}
}
struct Home_Previews: PreviewProvider {
static var previews: some View {
let managerVM = ManagerVM(withBlocs: [BlocVM(withBloc: Bloc(nom: "Total", ues: DataStub().load(), isUq: false)),BlocVM(withBloc: Bloc(nom: "Projet", ues: DataStub().loadUeStage_Proj(),isUq: true))])
Home(manager: managerVM )
}
}

@ -1,25 +0,0 @@
//
// HomeView.swift
// SwiftMvvm
//
// Created by etudiant on 23/05/2023.
//
import SwiftUI
struct HomeView: View{
var body: some View {
Text("Calculatrice ")
.font(.headline)
.padding(.trailing, 20)
.font(.headline)
.foregroundColor(.blue)
}
}
struct HomeView_Previews: PreviewProvider {
static var previews: some View {
HomeView()
}
}

@ -1,36 +0,0 @@
//
// ListUe.swift
// SwiftMvvm
//
// Created by etudiant on 25/05/2023.
//
import SwiftUI
struct ListUe: View {
var body: some View {
NavigationStack {
VStack(alignment: .leading) {
Label("UEs", systemImage: "doc.fill")
.font(.title)
Text("Détails des UEs")
LazyVStack {
HStack {
UeView(blocs: BlocVm(withModel: BlocModel(Nombloc: "HST", Moyenneg: 14, listeUE: [])))
Divider()
}
.padding()
}
.padding()
.background(Color("ListItemBackgroundColor"))
.cornerRadius(12)
}
}
}
struct ListUe_Previews: PreviewProvider {
static var previews: some View {
ListUe()
}
}}

@ -0,0 +1,98 @@
//
// CapsuleMatiere.swift
// SwiftMvvm
//
// Created by etudiant on 23/06/2023.
//
import Foundation
import SwiftUI
import UIKit
struct ExpandingCapsuleViewMatiere : View{
@ObservedObject var matiere : MatiereVM
@ObservedObject var ue : UeVM
@ObservedObject var bloc : BlocVM
var islock : Bool = true
@GestureState private var dragState = DragState.inactive
@State private var capsuleWidth: CGFloat = 25.0
var widthMax = 100.0
var widthMin = 5.0
enum DragState {
case inactive
case dragging(translation: CGSize)
var translation: CGSize {
switch self {
case .inactive:
return .zero
case .dragging(let translation):
return translation
}
}
}
public var body: some View {
let dragGesture = DragGesture()
.onEnded { value in
let dragThreshold: CGFloat = 0.02
let dragTranslation = value.translation.width
if CGFloat(matiere.moyenne)*5 <= 100 {
if dragTranslation > dragThreshold {
capsuleWidth += (dragTranslation - dragThreshold)
updateMoy()
// print(capsuleWidth/5)
} else if dragTranslation < -dragThreshold {
capsuleWidth = dragTranslation/5 - dragThreshold
updateMoy()
}
}
}
return GeometryReader { geometry in
Capsule()
.frame(width: Double(matiere.moyenne * 5) >= widthMax ? 100.0 : CGFloat(matiere.moyenne) * 5 + 2 , height: 22)
.foregroundColor(CGFloat(matiere.moyenne) * 5 < 50 ? .red : .green)
.gesture( islock ? DragGesture().onEnded({_ in }) : dragGesture)
.animation(.spring())
.offset(x: dragState.translation.width, y: 0)
.onAppear {
// Set initial capsule width
capsuleWidth = min(geometry.size.width, geometry.size.height)
}
}
}
private func updateMoy(){
self.matiere.moyenne += Float(capsuleWidth) / 5
if matiere.moyenne > 20 { matiere.moyenne = 20 }
if matiere.moyenne < 0 { matiere.moyenne = 0 }
ue.totalMoyenne = ue.updateTotalMoyenne()
bloc.totalMoyenne = bloc.updateTotalMoyenne()
print(bloc.nom)
}
}
struct CapsuleMatiere_Previews: PreviewProvider {
static var previews: some View {
ExpandingCapsuleViewMatiere(matiere: MatiereVM(withMat: Matiere(name: "Projet", moy: 12, coef: 9)),ue: UeVM(withUe: DataStub().loadUeStage_Proj()[0]),
bloc: BlocVM(withBloc: Bloc(nom: "", ues: DataStub().loadUeStage_Proj(), isUq: true)) )
}
}

@ -2,53 +2,55 @@
// MatiereEditView.swift // MatiereEditView.swift
// SwiftMvvm // SwiftMvvm
// //
// Created by etudiant on 10/06/2023. // Created by etudiant on 23/06/2023.
// //
import Foundation
import SwiftUI import SwiftUI
struct MatiereEditView: View {
@Binding var matiere : Matiere struct MatiereEditView : View{
@ObservedObject var matiere: MatiereVM
var body: some View { var body: some View {
VStack { HStack{
NavigationLink(destination: TextField("", text: $matiere.nom, prompt: Text("enter the name")) if self.matiere.isEditing {
.navigationBarTitleDisplayMode(.inline) VStack {
.navigationTitle("Name")) { TextField("Nom", text: $matiere.name)
HStack { TextField("Coefficient", value: $matiere.coef, format: .number)
Text("Nom") Divider()
Spacer()
Text(matiere.nom)
.foregroundColor(.gray)
}
} }
} else {
NavigationLink(destination: TextField("", value: $matiere.coefficient, format: .number, prompt: Text("enter the count")) VStack {
.navigationBarTitleDisplayMode(.inline) Text(matiere.name)
.navigationTitle("Hair count")) { Text(matiere.coef, format: .number)
HStack { Divider()
Text("coef")
Spacer()
Text(String(matiere.coefficient))
.foregroundColor(.gray)
}
} }
}
NavigationLink(destination: TextField("", value: $matiere.note, format: .number, prompt: Text("enter the note")) Button(action: {
.navigationBarTitleDisplayMode(.inline) if self.matiere.isEditing {
.navigationTitle("note")) { print(self.matiere.coef)
HStack {
Text("Note") self.matiere.onEdited(isCancelled: true)
Spacer() } else {
Text(String(matiere.note)) self.matiere.onEditing()
.foregroundColor(.gray)
}
} }
}) {
Text( self.matiere.isEditing ? "Done" : "Modifier")
}
} }
} }
} }
struct MatiereEditView_Previews: PreviewProvider { struct MatiereEditView_Previews: PreviewProvider {
static var previews: some View { static var previews: some View {
MatiereEditView(matiere: .constant(Stub().loadUes()[0].listeMatiere[0])) let matiere = MatiereVM(withMat: DataStub().loadMartiereUE1()[0])
MatiereEditView(matiere: matiere)
} }
} }

@ -1,73 +0,0 @@
// MatiereUniq.swift
// SwiftMvvm
//
// Created by etudiant on 30/05/2023.
//
import SwiftUI
struct MatiereUniq: View {
//1 changement avec Vm
@ObservedObject var mat: MatiereVm
@State private var islocked = true
var body: some View {
VStack(alignment: .leading) {
HStack {
Text(mat.nom)
.font(.title2)
Spacer()
Text("\(mat.coefficient)")
.font(.title2)
.padding(.horizontal, 30.0)
}
.padding(.horizontal, 11.0)
HStack {
Button(action: {
islocked.toggle()
}) {
Image(systemName: islocked ? "lock" : "lock.open")
.resizable()
.frame(width: 20, height: 20)
}
GeometryReader { geometry in
HStack {
Capsule()
.fill(mat.note < 10 ? .red : .blue)
.frame(height: 20)
.frame(width: CGFloat(mat.note) / 30 * geometry.size.width)
.gesture(
islocked ? DragGesture(minimumDistance: 0).onChanged({_ in })
: DragGesture(minimumDistance: 23)
.onChanged({ value in
let newNote = value.location.x / geometry.size.width * 20
mat.note = min(max(newNote, 0), 20)
})
)
Text("\(Double(mat.note))")
if !islocked {
Image("gouffle")
.resizable()
.frame(width: 20, height: 20)
}
}
}
Divider()
}
}
}
}
struct MatiereUniq_Previews: PreviewProvider {
static var previews: some View {
MatiereUniq(mat: MatiereVm(withModel: Matiere(id: UUID(), nom: "JAVA", coefficient: 6, note: 19)))
}
}

@ -0,0 +1,59 @@
//
// MatiereUi.swift
// SwiftMvvm
//
// Created by etudiant on 23/06/2023.
//
import Foundation
import SwiftUI
struct MatiereUnq: View{
@ObservedObject var matiere : MatiereVM
@ObservedObject var ue : UeVM
@ObservedObject var bloc : BlocVM
@State var islocked : Bool = true
var body: some View {
VStack(alignment:.leading){
Divider()
HStack(spacing: 20){
Text(matiere.name ).bold().font(.caption).padding()
}
HStack(spacing: 15){
Button(action: {
if self.matiere.isEditing {
self.matiere.onEdited(isCancelled: true)
print(self.matiere.moyenne)
} else {
self.matiere.onEditing()
}
}) {
Image(systemName: !matiere.isEditing ? "lock.fill" : "lock.open.fill")
}
ExpandingCapsuleViewMatiere(matiere: matiere, ue : ue, bloc : bloc ,islock: !matiere.isEditing).frame(width:50,height: 20)
Spacer()
Text(matiere.moyenne.description)
Spacer()
Text(matiere.coef.description)
}
}.padding()
}
}
struct MatiereUnq_Previews: PreviewProvider {
static var previews: some View {
MatiereUnq(matiere: MatiereVM(withMat: Matiere(name : "Projet",moy: 12, coef: 9)), ue: UeVM(withUe: DataStub().loadUeStage_Proj()[0]),
bloc: BlocVM(withBloc: Bloc(nom: "", ues: DataStub().loadUeStage_Proj(), isUq: true)),
islocked: true)
}
}

@ -1,60 +0,0 @@
import SwiftUI
struct MatiereView: View {
@ObservedObject var ue : UeVm
@State var isEditing: Bool = false
var body: some View {
NavigationStack {
ScrollView {
VStack(alignment: .leading) {
Label("Coefficient :\(ue.coefficient)", systemImage: "xmark.circle.fill")
Label("Détails des notes: ", systemImage: "note.text")
}
VStack {
ForEach(ue.someMatVM) { matiere in
MatiereUniq(mat: matiere)
}
}
.toolbar{
Button(action: {
self.isEditing.toggle()
}){
Text("Edit")
}
}
.sheet(isPresented: $isEditing){
NavigationStack{
EditableView(editableUe: ue)
.toolbar{
ToolbarItem(id: "done", placement: .confirmationAction){
Button(action: {
self.isEditing.toggle()
}){
Text("Done")
}
}
ToolbarItem(id: "cancel", placement: .cancellationAction){
Button(action: {
self.isEditing.toggle()
}){
Text("Cancel")
}
}
}
.navigationTitle("Edit: \(ue.nom)")
}
}
}
}
}
}
struct MatiereView_Previews: PreviewProvider {
static var previews: some View {
MatiereView(ue: UeVm(withModel: UE(id: UUID(), coefficient: 2, moyenne: 16, nom: "MAT", listeMatiere: [])))
}
}

@ -1,31 +0,0 @@
//
// Note.swift
// SwiftMvvm
//
// Created by etudiant on 08/06/2023.
//
//
// NoteInfo.swift
// App
//
// Created by BREUIL Yohann on 26/05/2023.
//
/*import SwiftUI
struct NoteInfo: View {
var body: some View {
VStack {
MatiereView(ue: <#UeVm#> )
Divider()
}
}
}
struct NoteInfo_Previews: PreviewProvider {
static var previews: some View {
NoteInfo()
}
}*/

@ -0,0 +1,91 @@
//
// CapsuleUe.swift
// SwiftMvvm
//
// Created by etudiant on 23/06/2023.
//
import Foundation
import SwiftUI
import UIKit
struct ExpandingCapsuleView : View{
@ObservedObject var ue : UeVM
@GestureState private var dragState = DragState.inactive
@State private var capsuleWidth: CGFloat = 5.0
private var widthMax = 100.0
private var widthMin = 5.0
private enum DragState {
case inactive
case dragging(translation: CGSize)
var translation: CGSize {
switch self {
case .inactive:
return .zero
case .dragging(let translation):
return translation
}
}
}
init(ue: UeVM) {
self.ue = ue
}
var body: some View {
let dragGesture = DragGesture()
.onEnded { value in
let dragThreshold: CGFloat = 1.005
let dragTranslation = value.translation.width
if dragTranslation > dragThreshold {
capsuleWidth += dragTranslation - dragThreshold
updateMoy()
} else if dragTranslation < -dragThreshold {
capsuleWidth -= abs(dragTranslation) - dragThreshold
updateMoy()
}
}
return GeometryReader { geometry in
Capsule()
.frame(width: capsuleWidth >= widthMax ? 100.0 : capsuleWidth , height: 30)
.foregroundColor(.blue)
.gesture(dragGesture)
.animation(.spring())
.offset(x: dragState.translation.width, y: 0)
.onAppear {
// Set initial capsule width
capsuleWidth = min(geometry.size.width, geometry.size.height)
}
}
}
private func updateMoy(){
var da = ue.model.totalMoyenne * capsuleWidth / 100
ue.model.coef = ue.model.coef + 1
print(da)
}
}
struct CapsuleV_Previews: PreviewProvider {
static var previews: some View {
ExpandingCapsuleView(ue : UeVM(withUe: Ue( nom: "UE 2", matieres: DataStub().loadMartiereUE2(),coef: 9)))
}
}

@ -1,45 +1,45 @@
import SwiftUI import SwiftUI
struct UeView: View {
public struct UeView : View{
@ObservedObject var blocs : BlocVm @ObservedObject var bloc : BlocVM
@ObservedObject var ue : UeVM
var body: some View { public var body: some View {
VStack {
ForEach(blocs.someUeVM) { ue in VStack(alignment:.leading){
HStack {
Text(ue.nom) Divider()
.font(.subheadline) HStack(spacing: 20){
.foregroundColor(.primary) Text(ue.nom ).bold().font(.caption).padding()
Spacer() Spacer()
Text("\(ue.coefficient)") Text(ue.coef.description)
NavigationLink(destination: MatiereView(ue: UeVm(withModel: UE(id: UUID(), coefficient: 4, moyenne: 3, nom: "HST", listeMatiere: [])) )) { }
Image(systemName: "square.and.pencil")
}
.foregroundColor(.blue) HStack(){
} Capsule().foregroundColor( ue.totalMoyenne * 5 < 50 ? .red : .green).frame(width: ue.totalMoyenne * 5 ,height: 22)
.padding(.bottom, 10) Spacer()
HStack { Text(ue.totalMoyenne.description)
Capsule() Spacer()
.fill(ue.moyenne < 10 ? .red : .blue) NavigationLink(destination: Uee(ue: ue, bloc: bloc)) {
.frame(height: 20) Image(systemName: "square.and.pencil")
.frame(width: CGFloat(ue.moyenne) * 10)
.background(Color.clear)
Text("\(ue.moyenne)")
} }
.padding()
Divider()
} }
} Divider()
.padding()
}.padding()
} }
} }
struct UeView_Previews: PreviewProvider { struct UeView_Previews: PreviewProvider {
static var previews: some View { static var previews: some View {
UeView(blocs: BlocVm(withModel: BlocModel(Nombloc: "ANG", Moyenneg: 12, listeUE: [])))
} let ue = DataStub().load()[0]
let ueVM = UeVM(withUe: ue)
UeView(bloc: BlocVM(withBloc: Bloc(nom: "Projet/Stage", ues: DataStub().loadUeStage_Proj(),isUq: true)), ue: ueVM)
}
} }

@ -0,0 +1,50 @@
//
// UePage.swift
// SwiftMvvm
//
// Created by etudiant on 23/06/2023.
//
import Foundation
import SwiftUI
struct Uee: View {
@ObservedObject var ue: UeVM
@ObservedObject var bloc: BlocVM
var body: some View {
NavigationView {
VStack {
HStack(spacing: 20) {
Text(ue.nom)
.bold()
.font(.title)
}
Divider()
HStack(spacing: 15) {
Capsule()
.foregroundColor(ue.totalMoyenne * 5 < 50 ? .red : .green)
.frame(width: ue.totalMoyenne * 5, height: 22)
Text(ue.coef.description)
Text(ue.totalMoyenne.description)
}
ScrollView {
ForEach(ue.someMatieresVM) { mat in
MatiereUnq(matiere: mat, ue : ue, bloc : bloc, islocked: true)
}
}
}
}
.navigationBarItems(trailing: Button(action: {
self.ue.onEditing()
}) {
Text( self.ue.isEditing ? "Done" : "Modifier")
})
.sheet(isPresented: $ue.isEditing) {
EditSheet(ue: ue, isEditMode: $ue.isAdding)
}
}
}

@ -1,27 +0,0 @@
//
// VuePrincipale.swift
// SwiftMvvm
//
// Created by etudiant on 25/05/2023.
//
import SwiftUI
struct VuePrincipale: View {
var body: some View {
NavigationStack {
ScrollView {
BlocView()
Divider()
ListUe()
}
.navigationTitle("Calculette")
}
}
}
struct VuePrincipale_Previews: PreviewProvider {
static var previews: some View {
VuePrincipale()
}
}

@ -0,0 +1,31 @@
//
// edit.swift
// SwiftMvvm
//
// Created by etudiant on 23/06/2023.
//
import Foundation
import SwiftUI
struct edit: View {
@Binding public var ue : Ue
var body: some View {
NavigationView{
VStack{
Text(ue.nom)
TextField("name", text:$ue.nom )
}
}.toolbar{
Button(action: {
}) {
Image(systemName: "square.and.pencil")
}
}
}
}

@ -1,24 +0,0 @@
//
// stbmat.swift
// SwiftMvvm
//
// Created by etudiant on 30/05/2023.
//
/*import SwiftUI
/*struct stbmat: View {
let matieres: [Matiere] = [
Matiere(id: UUID(), nom: "Mathématiques", coefficient: 2.0, note: 15.0),
Matiere(id: UUID(), nom: "Physique", coefficient: 1.5, note: 12.0),
Matiere(id: UUID(), nom: "Chimie", coefficient: 1.0, note: 10.5)
]
var body: some View {
VStack {
ForEach(matieres) { matiere in
MatiereUniq(mat: matiere)
}
}
}
}*/*/
Loading…
Cancel
Save