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.
35 lines
1.3 KiB
35 lines
1.3 KiB
![]()
2 years ago
|
//
|
||
![]()
2 years ago
|
// NotDisturbViewModels.swift
|
||
![]()
1 year ago
|
// FireBoltt
|
||
![]()
2 years ago
|
//
|
||
|
// Created by lemo. on 2020/3/29.
|
||
|
// Copyright © 2020 Sheldon. All rights reserved.
|
||
|
//
|
||
|
|
||
|
import UIKit
|
||
|
|
||
![]()
2 years ago
|
class NotDisturbViewModels: ViewModel {
|
||
![]()
2 years ago
|
|
||
|
var dataVariable = BehaviorRelay<[MultipleSectionModel]>(value: [])
|
||
|
var dataSource: [MultipleSectionModel] = []
|
||
|
var noDisturbModel: NoDisturbModel = NoDisturbModel()
|
||
|
|
||
|
override init() {
|
||
|
super.init()
|
||
|
if let temp = GlobalDeviceProfileModel.shareInstance.noDisturbModel?.copy() as? NoDisturbModel {
|
||
|
noDisturbModel = temp
|
||
|
}
|
||
![]()
1 year ago
|
fbloadData(model: noDisturbModel)
|
||
![]()
2 years ago
|
}
|
||
|
|
||
![]()
1 year ago
|
func fbloadData(model: NoDisturbModel) {
|
||
|
let cellModel = TableViewCellModel(title: MultiLanguageKey_FB.smartSwitchFB.localized, isSwitch: true, description: nil, isArrows: false, isOn: model.IsOpen, image: nil, isBottomLine: false)
|
||
![]()
2 years ago
|
let mod1 = MultipleSectionModel.SettingSection(title: "", items: [.TableViewCellModel(cellModel: cellModel)])
|
||
![]()
1 year ago
|
let mod2 = MultipleSectionModel.DoubleTimePickerSection(title: "", items: [SectionItem.DoubleTimePicker(leftTitle: MultiLanguageKey_FB.startTimeFB.localized, rightTitle: MultiLanguageKey_FB.endTimeFB.localized, selectedItems: [model.StartTime, model.EndTime])])
|
||
![]()
2 years ago
|
dataSource.append(mod1)
|
||
|
dataSource.append(mod2)
|
||
|
dataVariable.accept(dataSource)
|
||
|
}
|
||
|
|
||
|
}
|