Skip to content

Instantly share code, notes, and snippets.

@soggybag
Created December 10, 2015 15:19
Show Gist options
  • Save soggybag/872cc99aa9911c0b6931 to your computer and use it in GitHub Desktop.
Save soggybag/872cc99aa9911c0b6931 to your computer and use it in GitHub Desktop.
Rainbow tableview cells
// Somwhere inside of cellForRowAtIndexPath
// Color cells by changing hue
let hue = 1 / CGFloat(array.count) * CGFloat(indexPath.row)
cell.backgroundColor = UIColor(hue: hue, saturation: 1.0, brightness: 1.0, alpha: 1.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment