Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Use tableView(_:titleForHeaderInSection:) to set the title for each section in a table view.
- // This example exhibits two instances of this method used in this app.
- // This demonstrates the use of this method in this app's UITableViewDataSource view controller.
- func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
- switch section {
- case 0:
- return "Configuring a Table View"
- default:
- print("out of index")
- return ""
- }
- }
- // This demonstrates the use of this method in this app's UITableViewDelegate view controller.
- func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
- switch section {
- case 0:
- return "Configuring Rows"
- case 1:
- return "Managing Selections"
- case 2:
- return "Handling Swipe Actions"
- default:
- print("out of index")
- return ""
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement