Skip to content

Instantly share code, notes, and snippets.

@ericcgu
Created April 1, 2015 03:18
Show Gist options
  • Save ericcgu/0b56615ad6376d1067f3 to your computer and use it in GitHub Desktop.
Save ericcgu/0b56615ad6376d1067f3 to your computer and use it in GitHub Desktop.
HeaderCell
override func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let header = tableView.dequeueReusableCellWithIdentifier(kHeaderCellIdentifier) as RWStockHeaderCell
header.selectionStyle = UITableViewCellSelectionStyle.None
header.backgroundColor = kbackgroundColor
header.layer.borderWidth = 1
header.layer.borderColor = UIColor.whiteColor().CGColor
if (dataType == kDataType.stocks) {
(header.viewWithTag(1) as UILabel).text = kStockFieldNames.quarterfrequency.description()
(header.viewWithTag(2) as UILabel).text = kStockFieldNames.onFarm.description()
(header.viewWithTag(3) as UILabel).text = kStockFieldNames.offFarm.description()
(header.viewWithTag(4) as UILabel).text = kStockFieldNames.total.description()
header.updateConstraints()
}
return header
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment