I have the following dictionary:
var deckDictionary = [
"card1": ["ace","hearts"],
"card2": ["ace","spades"],
"card3": ["ace","diamonds"],
"card4": ["ace","clubs"],
]
What I want to do is set cardSuit2 to be equal to the 2nd object in the array with key "card2" like so (pseudo-code):
var cardKey2 = "card2"
var cardSuit2 = whatever the card suit value is at cardKey2 ([[deckDictionary[1]][1]]?)
So for instance in this case, cardSuit2 would be equal to the 2nd object in the array with key "card2", so "spades". How would I go about doing this?
var cardSuit1 = ([[deckDictionary[1]][1]]), and it gives me an error statingCannot subscript a value of type '[String : Array<String>]' with an index of type 'Int'