Monday, May 22, 2017

Dictionary of Arrays in Swift 3

The code below shows how to include an array in a dictionary in Swift 3.1 with Xcode 8.3.1 Playground.

dictionarySemitones["abc"]=[1,2,3]
dictionarySemitones["def"]=[4,5,6]

print(dictionarySemitones)
print(dictionarySemitones["abc"]!)

Reference:

A Dictionary of Arrays in Swift

No comments:

Post a Comment