Category Archives: Table View with Number List

Table View with Number List

// Created by Mohammad Azmal Hossain on 11/22/16.
// Copyright © 2016 Mohammad Azmal Hossain. All rights reserved.
//

import UIKit

class ViewController: UIViewController, UITableViewDataSource {

 func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
 return 10
 }
 func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
 let cell = UITableViewCell()
 cell.textLabel!.text = "this is row \(indexPath.row)"
 return cell
 }
 
 override func viewDidLoad() {
 super.viewDidLoad()
 // Do any additional setup after loading the view, typically from a nib.
 }

 override func didReceiveMemoryWarning() {
 super.didReceiveMemoryWarning()
 // Dispose of any resources that can be recreated.
 }


}
Advertisements