Skip to content

Instantly share code, notes, and snippets.

@superarts
Last active August 29, 2015 14:15
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 superarts/063c2c3f0e77940db199 to your computer and use it in GitHub Desktop.
Save superarts/063c2c3f0e77940db199 to your computer and use it in GitHub Desktop.
Table controller.
override func viewDidLoad() {
super.viewDidLoad()
lf_actionReload()
}
override func lf_actionReload() {
var array: Array<LTDictStrObj> = [ [
"title": "Title 1",
"desc": "Description",
], [
"title": "Title 2",
"desc": "Description",
] ]
source.counts = [array.count]
source.func_height = {
(path: NSIndexPath) -> CGFloat in
return 48
}
source.func_cell = {
(path: NSIndexPath) -> UITableViewCell in
let cell = self.table.dequeueReusableCellWithIdentifier("SGPracticeCell") as SGPracticeCell
cell.textLabel!.text = array[path.row]["title"] as String!
cell.detailTextLabel!.text = array[path.row]["desc"] as String!
return cell
}
source.func_select = {
(path: NSIndexPath) -> Void in
self.table.deselectRowAtIndexPath(path, animated: true)
}
source.func_deselect = {
(path: NSIndexPath) -> Void in
}
super.lf_actionReload()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment