ios - Best approach to cycle through background colors for collection cells in Swift? -


in swift, best approach loop through background colors cells in collection view? know if(indexpath.row % 2 == 0), putting logic in if clause seems clunky if there going more 2 color options.

my initial thought put list of colors in array , loop through them. possible loop through array in swift within cellforitematindexpath? there better approach looping through array of background colors?


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -