Reputation: 1172
I am new to swift programming. I have written the following code for iterating and printing dictionary
var items_price = [
"milk": 1 ,
"bread" : 3,
"egg" : 2
]
for (myKey, myValue) in items_price {
println ("\(myKey) costs : \(myValue)")
}
This code is not printing the result as "milk costs: 1" ,etc. What is wrong?
Upvotes: 1
Views: 2122
Reputation: 27335
println
statements are printed in timeline of playgrounds. Press the "+" in the circle at the end of print statement line.
Upvotes: 3