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.
34 lines
796 B
34 lines
796 B
// |
|
// SinglePickerViewModel.swift |
|
// Lookfit |
|
// |
|
// Created by lemo on 2018/6/4. |
|
// Copyright © 2020年 ecell. All rights reserved. |
|
// |
|
|
|
import UIKit |
|
|
|
class SinglePickerViewModel: NSObject { |
|
let dataSourceVariable = BehaviorRelay<[String]>(value: []) |
|
var dataSource = [String]() |
|
|
|
override init() { |
|
super.init() |
|
|
|
} |
|
|
|
init(funtionType: FunctionType) { |
|
switch funtionType { |
|
case .heartRateMonitor: |
|
dataSource = (1...6).map{"\($0 * 10)"} |
|
case .drinkRemind: |
|
dataSource = (1...6).map{"\($0 * 30)"} |
|
case .sedentary: |
|
dataSource = (1...12).map{"\($0 * 30)"} |
|
default: |
|
dataSource = (1...6).map{"\($0 * 30)"} |
|
} |
|
dataSourceVariable.accept(dataSource) |
|
} |
|
|
|
}
|
|
|