LoginSignup
9
9

More than 5 years have passed since last update.

Swift で Dictionary の中身を for 文で回したい時

Posted at
sample

let dict = ["hoge":"fuga", "piyo":"foo"]

for (key,value) in dict{
    NSLog("Key: %@", key)
    NSLog("Value: %@", value)
}

Key: hoge
Value: fuga
Key: piyo
Value: foo

Objective-C の頃はこんな感じだったので、楽になった。
http://qiita.com/happy_ryo/items/a48e222837b7f0eedec1

9
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
9