Skip to content

Instantly share code, notes, and snippets.

@flexaddicted
Created February 20, 2015 10:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flexaddicted/5834e9a0e209d6daa5c0 to your computer and use it in GitHub Desktop.
Save flexaddicted/5834e9a0e209d6daa5c0 to your computer and use it in GitHub Desktop.
import UIKit
class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
@IBOutlet var tableView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
self.tableView.registerClass(UITableViewCell.self, forCellReuseIdentifier: "MyCellIdentifier")
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 10
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
var cell: UITableViewCell = tableView.dequeueReusableCellWithIdentifier("MyCellIdentifier") as UITableViewCell
cell.textLabel?.text = "Swipe to delete row"
return cell
}
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment