<bikeshed>
It should be isEvenlyDivisible(by:)
, because 10 is divisible by 3. Just not evenly divisible.
</bikeshed>
Edited to add:
I'd be in favor of adding isOdd
and isEven
because:
they increase readability and therefore expressivity
It makes mapping or ternary logic simpler which increases readability and therefore expressivity
view.backgroundColor = row.isEven ? .white : .lightGray
vs
view.backgroundColor = (row % 2 == 0) ? .white : .lightGray // extra parentheses yuck