Question : table view
Answered by : md-murad-hossain
//
// ViewController.swift
// CustomSectionHeader
//
// Created by Md Murad Hossain on 17/10/22.
//
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() } 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 }
}
Source : | Last Update : Mon, 24 Oct 22