tableview
uicontroller需要继承
UITableViewDelegate,UITableViewDataSource
实现
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return listModel.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
return cell
}
两个方法
tintcolor实现图片颜色更换
子类继承父类的xib
在子类中重写init方法
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
super.init(nibName: "", bundle: nil)
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}