回答編集履歴
1
追記
test
CHANGED
@@ -1,3 +1,37 @@
|
|
1
1
|
おそらくURLの生成に失敗しています。
|
2
2
|
|
3
3
|
日本語などのマルチバイト文字はURLエンコードしてください。
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
----
|
8
|
+
|
9
|
+
追記:
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
`json["items"]`は配列なので
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
```swift
|
18
|
+
|
19
|
+
json["items"].array?.forEach { item in
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
let article: [String: String?] = [
|
24
|
+
|
25
|
+
"title": item["snippet"]["title"].string,
|
26
|
+
|
27
|
+
"userId": item["id"]["videoId"].string,
|
28
|
+
|
29
|
+
]
|
30
|
+
|
31
|
+
self.articles.append(article)
|
32
|
+
|
33
|
+
}
|
34
|
+
|
35
|
+
```
|
36
|
+
|
37
|
+
こうじゃないですかね。
|