//
// WangMuMuVC.swift
// RXFunction
//
// Created by 王木木 on 16/11/1.
// Copyright © 2016年 王木木. All rights reserved.
//
import UIKit
import RxSwift
import RxCocoa
class WangMuMuVC: UIViewController {
let tableView: UITableView = UITableView()
let bag: DisposeBag = DisposeBag()
var identifier: String = "Cell"
override func viewDidLoad() {
super.viewDidLoad()
tableView.frame = view.bounds
view.addSubview(tableView)
let cellSelf = UITableViewCell.self
tableView.registerClass(cellSelf, forCellReuseIdentifier: identifier)
getModelData()
.bindTo(tableView.rx_itemsWithCellIdentifier(identifier, cellType: cellSelf))
{ (row, element, cell) in
cell.textLabel?.text = element.name
}.addDisposableTo(bag)
}
func getModelData() -> Observable<[PWCellModel]>{
return Observable.just([
PWCellModel(name: "原始密码"),
PWCellModel(name: "新的密码"),
PWCellModel(name: "确认密码")
]
)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
struct PWCellModel {
let name: String
}