Created
October 31, 2014 21:52
-
-
Save diederikh/17671de8bf86339d8378 to your computer and use it in GitHub Desktop.
table testje
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ViewController: UITableViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view, typically from a nib. | |
} | |
override func didReceiveMemoryWarning() { | |
super.didReceiveMemoryWarning() | |
// Dispose of any resources that can be recreated. | |
} | |
override func numberOfSectionsInTableView(tableView: UITableView) -> Int { | |
return 5 | |
} | |
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | |
return 5 | |
} | |
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { | |
let cell = tableView.dequeueReusableCellWithIdentifier("MyCell", forIndexPath: indexPath) as UITableViewCell | |
return cell | |
} | |
override func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { | |
let view = UIView(frame: CGRect(x: 0, y: 0, width: 768, height: 44)) | |
let label = UILabel() | |
label.text = "Header \(section)" | |
label.frame = view.bounds | |
label.textAlignment = .Center | |
view.addSubview(label) | |
return view | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment