-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataTableViewController.swift
More file actions
37 lines (27 loc) · 1.07 KB
/
DataTableViewController.swift
File metadata and controls
37 lines (27 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//
// DataTableViewController.swift
// TableExample
//
// Created by MyAir on 10/15/15.
// Copyright © 2015 MyAir. All rights reserved.
//
import UIKit
class DataTableViewController: UITableViewController {
// MARK: - UITableViewDataSource
override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
// Return the number of sections.
return 3
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// Return the number of rows in the section.
return 5
}
override func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
return "Section \(section)"
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("LabelCell", forIndexPath: indexPath)
cell.textLabel?.text = "Section \(indexPath.section) Row \(indexPath.row)"
return cell
}
}