Category Archives: Table View

Table View

// Created by MohammadAzmalHossain on 11/19/16.
import UIKit
class ViewController: UIViewController, UITableViewDataSource {
 func numberOfSections(in tableView: UITableView) -> Int {
 return 1
 }
 func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
 return 5
 }
 func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
 let cell = UITableViewCell()
 cell.textLabel?.text = "Hello World"
 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