diff --git a/Graduator/Graduator/Data/Stub.swift b/Graduator/Graduator/Data/Stub.swift index 4cd9121..31f23ea 100644 --- a/Graduator/Graduator/Data/Stub.swift +++ b/Graduator/Graduator/Data/Stub.swift @@ -121,7 +121,7 @@ struct Stub { ), Subject( id: UUID(), - name: "Architecture de projetc C# .NET (1)", + name: "Architecture de projet C# .NET (1)", weight: 5, grade: 14.5/20.0 ), @@ -148,7 +148,7 @@ struct Stub { subjects: [ Subject( id: UUID(), - name: "Architecture de projetc C# .NET (2)", + name: "Architecture de projet C# .NET (2)", weight: 4, grade: 12.17/20.0 ), diff --git a/README.md b/README.md index 6ef3b57..5e7ece5 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,14 @@ Graduator is an iOS application developed with SwiftUI that helps users manage t Beyond those basic features, some details need to be specified here. +### Persistence + +The data is set to be persisted, unless you're using XCode's previewer canvas. + +The local persistence solution has been tested manually on the iOS Simulator. + +Upon first launching the app, it is set up to load a stub. + ### Weighted average A weighted average means that a `subject` or `unit`'s weight plays a part in calculating the average. Users can observe that increasing the weight of a `subject`, for instance, will make the average of the parent `unit` tend more towards that `subject`'s grade. @@ -39,6 +47,7 @@ After a grade was changed, in order to save the change and to see it reflected i Finally, users can create a `subject` when in edit mode. After clicking on *'Modifier'*, look for a `+` in the top navigation bar. +subject deleted creating a subject subject created @@ -130,9 +139,9 @@ classDiagram It might be useful to note that, just like `UnitVM`s aggregate `SubjectVM`s, `Unit`s aggregate `Subject`s, but these relationship between `Model` entities were removed from the diagram above for clarity. -The same is true with the View-related classes. +The same is true with the `View`-related classes. -Here is the diagram with those relationships depicted. +Here is the diagram with those relationships depicted, and the local persistence solution added. @@ -146,6 +155,7 @@ classDiagram class UnitsManagerVM { -original: UnitsManager + +load() +model: UnitsManager.Data +isEdited: Bool +isAllEditable: Bool @@ -175,6 +185,9 @@ classDiagram class UnitsManager { + -store: UnitsStore + +save() + +load() +getTotalAverage(): Double? +getProfessionalAverage(): Double? +getAverage(units: Unit[]): Double? @@ -198,6 +211,11 @@ classDiagram +data: Data +update(from: Data) } + + class UnitsStore { + +load(defaultValue: T[]) + +save(elements: T[]) + } MainView --> "*" UnitView MainView --> UnitsManagerVM @@ -215,5 +233,8 @@ classDiagram SubjectVM --> Subject UnitsManager --> "*" Unit + UnitsManager --> UnitsStore + UnitsManager --> Stub + Stub --> "*" Unit Unit --> "*" Subject ```