LoginSignup
0
0

More than 5 years have passed since last update.

swift3でjsonをパースして配列に格納したい

Last updated at Posted at 2017-04-26

何層にも重なるjsonディクショナリーからそれぞれの階層の特定の位置にあるインデックスだけ取り出して配列にappendしたいと思いました。

step1

空っぽの配列をAnyで準備します

var CastAnotherThemeList: [Any] = []

step2

for文の中でjsonを取得して取得してAnyに変換して変数に入れる

var AnotherJsonList = json_list[i]["list_name"] as Any

step3

配列にappend

CastAnotherThemeList.append(AnotherThemeList)

参考

0
0
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
0
0