Guest User

Untitled

a guest
May 21st, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. class TableViewController: UITableViewController {
  2.  
  3. override func viewDidLoad() {
  4. super.viewDidLoad()
  5. // Remember to use registerCell if you created a cell by code or XIB.
  6. }
  7.  
  8. override func didReceiveMemoryWarning() {
  9. super.didReceiveMemoryWarning()
  10. }
  11.  
  12. // MARK: - UITableViewDataSource
  13. override func numberOfSections(in tableView: UITableView) -> Int {
  14. return 1
  15. }
  16.  
  17. override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
  18. return 5
  19. }
  20.  
  21.  
  22. override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
  23. let cell = tableView.dequeueReusableCell(withIdentifier: "default", for: indexPath)
  24.  
  25. // Configure the cell...
  26. cell.textLabel?.text = "Section:\(indexPath.section), Row:\(indexPath.row)"
  27. cell.detailTextLabel?.text = "Detail to cell \(indexPath.row)"
  28.  
  29.  
  30. return cell
  31. }
  32.  
  33. // MARK: - UITableViewDataSource
  34. override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
  35. //Use to verify when a cell is select
  36. }
  37. }
Add Comment
Please, Sign In to add comment