You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.3 KiB
50 lines
1.3 KiB
// |
|
// NutritionSectionModel.swift |
|
// VeSync |
|
// |
|
// Created by Sheldon on 2020/3/24. |
|
// Copyright © 2020 Etekcity. All rights reserved. |
|
// |
|
|
|
import Foundation |
|
|
|
enum HealthSection { |
|
case health(title: String, items: [HealthSectionItem]) |
|
} |
|
|
|
enum HealthSectionItem { |
|
case stepItem(viewModel: StepCellViewModels) |
|
case healthItem(viewModel: HealthCellViewModels) |
|
case blankItem |
|
// case sleepItem(viewModel: HealthCellViewModels) |
|
// case heartRateItem(viewModel: HealthCellViewModels) |
|
// case temperatureItem(viewModel: HealthCellViewModels) |
|
// case bloodPressureItem(viewModel: HealthCellViewModels) |
|
// case bloodOxygenItem(viewModel: HealthCellViewModels) |
|
|
|
case sleepHeartItem(viewModel: SleepHeartCellViewModels) |
|
case sportItem(viewModel: SportCellViewModels) |
|
case temperatureIitem(viewModel: TemperatureCellModel) |
|
} |
|
|
|
extension HealthSection: SectionModelType { |
|
typealias Item = HealthSectionItem |
|
|
|
var title: String { |
|
switch self { |
|
case .health(let title, _): return title |
|
} |
|
} |
|
|
|
var items: [HealthSectionItem] { |
|
switch self { |
|
case .health(_, let items): return items.map {$0} |
|
} |
|
} |
|
|
|
init(original: HealthSection, items: [Item]) { |
|
switch original { |
|
case .health(let title, let items): self = .health(title: title, items: items) |
|
} |
|
} |
|
}
|
|
|