Created
February 20, 2015 10:18
-
-
Save flexaddicted/5834e9a0e209d6daa5c0 to your computer and use it in GitHub Desktop.
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
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