I have a Swift dictionary. I want to get my key's value. Object for key method is not working for me. How do you get the value for a dictionary's key?
This is my dictionary:
var companies = ["AAPL" : "Apple Inc", "GOOG" : "Google Inc", "AMZN" : "Amazon.com, Inc", "FB" : "Facebook Inc"]
for name in companies.keys {
print(companies.objectForKey("AAPL"))
}
if let airportName = airports["DUB"] { … }
" – Danica