Last active
August 29, 2015 14:06
-
-
Save chrisjones-brack3t/8b61e41b29da08da372b 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 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