Last active
August 29, 2015 14:15
-
-
Save superarts/063c2c3f0e77940db199 to your computer and use it in GitHub Desktop.
Table controller.
This file contains hidden or 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
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