Advertisement
srk72

Set value to 3 values iterating like 3 version of 10/2 == 0

Feb 1st, 2022
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. // set color for albums
  2. let indexValue = indexPath.row % 3
  3. if indexValue == 1 {
  4. cell.backgroundImage.tintColor = colorArray[1]
  5. cell.openBut.tintColor = colorArray[1]
  6. } else if indexValue == 2 {
  7. cell.backgroundImage.tintColor = colorArray[2]
  8. cell.openBut.tintColor = colorArray[2]
  9. } else if indexValue == 0 {
  10. cell.backgroundImage.tintColor = colorArray[0]
  11. cell.openBut.tintColor = colorArray[0]
  12. }
  13.  
  14. if indexPath.row == 0 {
  15. cell.backgroundImage.tintColor = colorArray[0]
  16. cell.openBut.tintColor = colorArray[0]
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement