Skip to content

Instantly share code, notes, and snippets.

@chrisjones-brack3t
Last active August 29, 2015 14:06
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 chrisjones-brack3t/8b61e41b29da08da372b to your computer and use it in GitHub Desktop.
Save chrisjones-brack3t/8b61e41b29da08da372b to your computer and use it in GitHub Desktop.
import UIKit
class SettingsTableViewController: UITableViewController {
let items: [String] = ["Some", "Text", "For", "The", "Cells"]
override func viewDidLoad() {
super.viewDidLoad()
let tableCell = UITableViewCell.self
tableView.registerClass(tableCell, forCellReuseIdentifier: "cell")
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return items.count
}
override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
return 1
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath)
-> UITableViewCell {
var cell = tableView.dequeueReusableCellWithIdentifier("cell") as? UITableViewCell
cell?.textLabel?.text = items[indexPath.row]
return cell!
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment