35 lines
769 B
Swift
35 lines
769 B
Swift
//
|
|
// EmergencyContactVM.swift
|
|
// QuickLocation
|
|
//
|
|
// Created by 八条 on 2026/6/11.
|
|
//
|
|
|
|
import RxSwift
|
|
import RxDataSources
|
|
|
|
typealias EmergencyContactListSectionModel = SectionModel<String, EmergencyContactModel>
|
|
|
|
class EmergencyContactViewModel {
|
|
|
|
struct Output {
|
|
var sectionedItems: Observable<[EmergencyContactListSectionModel]>
|
|
}
|
|
|
|
let output: Output
|
|
|
|
private var disposeBag = DisposeBag()
|
|
private let sectionedItems = PublishSubject<[EmergencyContactListSectionModel]>()
|
|
|
|
func loadData(_ list: [EmergencyContactModel]) {
|
|
sectionedItems.onNext(list.mapSection())
|
|
}
|
|
|
|
// MARK: - Init
|
|
init() {
|
|
output = Output(
|
|
sectionedItems: sectionedItems.asObservable()
|
|
)
|
|
}
|
|
}
|