I have an array of six colors and another array of 8 elements. Is there a way to repeat colorsArray as the number of elements starting from the first color in colorsArray in the same order?
var colorsArray = [UIColor.redColor(), UIColor.purpleColor(), UIColor.blueColor(), UIColor.greenColor(), UIColor.yellowColor(), UIColor.orangeColor()];
the new array will look like this:
newColorsArrayByItemsNumber = [UIColor.redColor(), UIColor.purpleColor(), UIColor.blueColor(), UIColor.greenColor(), UIColor.yellowColor(), UIColor.orangeColor(), UIColor.redColor(), UIColor.purpleColor()];
source
share