Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. // Use tableView(_:titleForHeaderInSection:) to set the title for each section in a table view.
  2. // This example exhibits two instances of this method used in this app.
  3.  
  4. // This demonstrates the use of this method in this app's UITableViewDataSource view controller.
  5. func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
  6. switch section {
  7. case 0:
  8. return "Configuring a Table View"
  9. default:
  10. print("out of index")
  11. return ""
  12. }
  13. }
  14.  
  15. // This demonstrates the use of this method in this app's UITableViewDelegate view controller.
  16. func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
  17. switch section {
  18. case 0:
  19. return "Configuring Rows"
  20. case 1:
  21. return "Managing Selections"
  22. case 2:
  23. return "Handling Swipe Actions"
  24. default:
  25. print("out of index")
  26. return ""
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement