import UIKit
class ViewController: UIViewController, UITableViewDataSource,UITableViewDelegate{
@IBOutlet weak var tableView: UITableView!
let array = ["One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten"]
override func viewDidLoad() {
super.viewDidLoad()
setupTabelViewCell()
}
func setupTabelViewCell() {
let nib = UINib(nibName: "tableViewCell", bundle: nil)
tableView.register(nib, forCellReuseIdentifier: "cell")
tableView.separatorColor = .none
tableView.delegate = self
tableView.dataSource = self
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return array.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath)
cell.textLabel?.text = array[indexPath.row]
return cell
}
}