Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ids once more #22

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion LiveRecipes/Modules/Creation/CreationModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ final class CreationModel: ObservableObject, CreationModelProtocol {
for dish in dishes {
print("---")
print("id: \(String(describing: dish.id))")
print("dish.id: \(String(describing: dish.id))")
print("dish.netId: \(String(describing: dish.netId))")
print("title: \(dish.title)")
print("description: \(dish.description)")
print("timeToPrepare: \(dish.timeToPrepare)")
Expand All @@ -29,7 +31,7 @@ final class CreationModel: ObservableObject, CreationModelProtocol {
for step in dish.dishSteps {
print("---")
print("step.id: \(step.id)")
print("step.title: \(step.stepTime)")
print("step.stepTime: \(step.stepTime)")
print("step.description: \(step.description)")
print("step.photo: \(step.photo == nil ? "NO" : "YES")")
}
Expand Down
3 changes: 1 addition & 2 deletions LiveRecipes/Modules/Creation/Dish.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class Dish: Identifiable, Hashable {
}

var id: Int?//если еще нет в базе данных, в процесе создания
var myId: Int = -1
var netId: Int = -1
var title: String
var description: String
Expand Down Expand Up @@ -67,7 +66,7 @@ class Dish: Identifiable, Hashable {
dishCompositionsEntities: [CreationRecipeCompositionEntity],
dishStepsEntities: [CreationRecipeStepEntity])
{
self.myId = Int(recipeEntity.recipeMyId)
self.id = Int(recipeEntity.recipeMyId)
self.netId = Int(recipeEntity.recipeNetId)
self.title = recipeEntity.dishTitle
self.description = recipeEntity.dishDescription
Expand Down
6 changes: 3 additions & 3 deletions LiveRecipes/Modules/Creation/StepView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ struct StepView: View {
didSet {
print("dishStep did set")
let totalSeconds = dishStep?.stepTime ?? 0
hours = totalSeconds / 3600
self.hours = totalSeconds / 3600
let remainingSeconds = totalSeconds % 3600
minutes = remainingSeconds / 60
seconds = remainingSeconds % 60
self.minutes = remainingSeconds / 60
self.seconds = remainingSeconds % 60
}
}
var creationViewModel: CreationViewModel
Expand Down
Loading