Advertisement
Guest User

Untitled

a guest
Feb 21st, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. import UIKit
  2.  
  3. class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
  4. @IBOutlet weak var tableView: UITableView!
  5.  
  6. func numberOfSections(in tableView: UITableView) -> Int {
  7. return 1
  8. }
  9.  
  10. func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
  11. return 2
  12. }
  13.  
  14. func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
  15. return tableView.dequeueReusableCell(withIdentifier: "CellOne", for: indexPath)
  16. }
  17.  
  18. func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
  19. print("Selected the row")
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement