Swift 3 – Using .map to walk through and create an array of items with offset Sometimes I want to create a quick way to add a number of items with a name; such as creating 10 decks with an offset number. Usually this can be done like this; // usual way; var decks : [Deck] = [Deck]() for idx in 1…10 { decks.append( Deck.init(name: “#\(idx)”) ) } But I find […]