I want to achieve the effect where one cell of the table view will have blue background, the next one will have white, the next one will have blue again, and then white and
Add backgroundView to the cell and set its background color of your choice.
let backgroundView = View() // add background view via code or via storyboard
view.backgroundColor = UIColor.red // your color
cell.backgroundView = backgroundView