Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func colorForIndex(index: Int) -> UIColor
- {
- let itemCount = stnRepos.count - 1
- let color = (CGFloat(index) / CGFloat(itemCount)) * 0.6
- return UIColor(red: 0.80, green: color, blue: 0.0, alpha: 1.0)
- }
- func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell,
- forRowAtIndexPath indexPath: NSIndexPath)
- {
- var count = stnRepos.count
- for (var i = 0; i<=count; i++)
- {
- if (i % 2 == 0)
- {
- cell.backgroundColor = colorForIndex(indexPath.row)
- println(i)
- }
- }
- }
- func colorForIndex(index: Int) -> UIColor
- {
- let itemCount = stnRepos.count - 1
- let color = (CGFloat(index) / CGFloat(itemCount)) * 0.6
- return UIColor(red: 0.80, green: color, blue: 0.0, alpha: 1.0)
- }
- func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell,
- forRowAtIndexPath indexPath: NSIndexPath)
- {
- if (indexPath.row % 2 == 0)
- {
- cell.backgroundColor = colorForIndex(indexPath.row)
- } else {
- cell.backgroundColor = UIColor.whiteColor()()
- }
- }
- - tableView:willDisplayCell:forTableColumn:row:
- func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell,
- forRowAtIndexPath indexPath: NSIndexPath)
- {
- if (indexPath.row % 2 == 0)
- {
- cell.backgroundColor = colorForIndex(indexPath.row)
- }
- else
- {
- cell.backgroundColor = UIColor.whiteColor()
- }
- }
- func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell,
- forRowAtIndexPath indexPath: NSIndexPath)
- {
- if (indexPath.row % 2 == 0)
- {
- cell.backgroundColor = UIColor.gray
- } else {
- cell.backgroundColor = UIColor.white
- }
- cell.backgroundColor = colorForIndex(indexPath.row)
- cell.contentView.backgroundColor = colorForIndex(indexPath.row)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement