import UIKit
class ViewController: UIViewController , UITableViewDataSource, UITableViewDelegate {
var tableView : UITableView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
tableView = UITableView(frame: CGRect(x: 0, y: 30, width: self.view.bounds.size.width, height: self.view.bounds.size.height), style: UITableViewStyle.plain)
tableView.delegate = self
tableView.dataSource = self
self.view .addSubview(tableView)
tableView .register(GoodsTableViewCell.classForCoder(), forCellReuseIdentifier: "cell")
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
r
Swift练习小demo tableView 自定义cell 简单实用
最新推荐文章于 2024-04-25 09:57:21 发布