質問編集履歴
1
JSONを追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -103,3 +103,227 @@
|
|
103
103
|
```
|
104
104
|
|
105
105
|
このようにTwitterのタイムラインのJSONを受信することはできたのですが、Swiftでforeachで配列を回して、ツイート本文やユーザーネームを取り出して表示するにはどのようにすればいいのでしょうか?
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
JSONはこのような感じです
|
112
|
+
|
113
|
+
[
|
114
|
+
|
115
|
+
{
|
116
|
+
|
117
|
+
"place" : null,
|
118
|
+
|
119
|
+
"contributors" : null,
|
120
|
+
|
121
|
+
"source" : "<a href=\"http:\/\/twitter.com\" rel=\"nofollow\">Twitter Web Client<\/a>",
|
122
|
+
|
123
|
+
"truncated" : false,
|
124
|
+
|
125
|
+
"is_quote_status" : false,
|
126
|
+
|
127
|
+
"favorite_count" : 0,
|
128
|
+
|
129
|
+
"lang" : "ja",
|
130
|
+
|
131
|
+
"entities" : {
|
132
|
+
|
133
|
+
"symbols" : [
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
],
|
138
|
+
|
139
|
+
"user_mentions" : [
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
],
|
144
|
+
|
145
|
+
"urls" : [
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
],
|
150
|
+
|
151
|
+
"hashtags" : [
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
]
|
156
|
+
|
157
|
+
},
|
158
|
+
|
159
|
+
"in_reply_to_screen_name" : null,
|
160
|
+
|
161
|
+
"retweet_count" : 0,
|
162
|
+
|
163
|
+
"favorited" : false,
|
164
|
+
|
165
|
+
"geo" : null,
|
166
|
+
|
167
|
+
"id" : 852734851786579974,
|
168
|
+
|
169
|
+
"user" : {
|
170
|
+
|
171
|
+
"protected" : false,
|
172
|
+
|
173
|
+
"is_translator" : false,
|
174
|
+
|
175
|
+
"profile_image_url" : "http:\/\/pbs.twimg.com\/profile_images\/850998804878774272\/-bABtccG_normal.jpg",
|
176
|
+
|
177
|
+
"created_at" : "Mon Apr 05 08:12:28 +0000 2010",
|
178
|
+
|
179
|
+
"id" : 129746204,
|
180
|
+
|
181
|
+
"default_profile_image" : false,
|
182
|
+
|
183
|
+
"listed_count" : 1542,
|
184
|
+
|
185
|
+
"profile_background_color" : "131516",
|
186
|
+
|
187
|
+
"follow_request_sent" : false,
|
188
|
+
|
189
|
+
"location" : "PSO2",
|
190
|
+
|
191
|
+
"entities" : {
|
192
|
+
|
193
|
+
"url" : {
|
194
|
+
|
195
|
+
"urls" : [
|
196
|
+
|
197
|
+
{
|
198
|
+
|
199
|
+
"url" : "http:\/\/www.pixiv.net\/member.php?id=76712",
|
200
|
+
|
201
|
+
"indices" : [
|
202
|
+
|
203
|
+
0,
|
204
|
+
|
205
|
+
40
|
206
|
+
|
207
|
+
],
|
208
|
+
|
209
|
+
"expanded_url" : null
|
210
|
+
|
211
|
+
}
|
212
|
+
|
213
|
+
]
|
214
|
+
|
215
|
+
},
|
216
|
+
|
217
|
+
"description" : {
|
218
|
+
|
219
|
+
"urls" : [
|
220
|
+
|
221
|
+
{
|
222
|
+
|
223
|
+
"display_url" : "ask.fm\/patrietta",
|
224
|
+
|
225
|
+
"url" : "https:\/\/t.co\/fLNYk70nQJ",
|
226
|
+
|
227
|
+
"indices" : [
|
228
|
+
|
229
|
+
67,
|
230
|
+
|
231
|
+
90
|
232
|
+
|
233
|
+
],
|
234
|
+
|
235
|
+
"expanded_url" : "http:\/\/ask.fm\/patrietta"
|
236
|
+
|
237
|
+
}
|
238
|
+
|
239
|
+
]
|
240
|
+
|
241
|
+
}
|
242
|
+
|
243
|
+
},
|
244
|
+
|
245
|
+
"url" : "http:\/\/www.eeee.net\/member.php",
|
246
|
+
|
247
|
+
"description" : "とあるuser",
|
248
|
+
|
249
|
+
"followers_count" : 69707,
|
250
|
+
|
251
|
+
"geo_enabled" : false,
|
252
|
+
|
253
|
+
"lang" : "ja",
|
254
|
+
|
255
|
+
"profile_text_color" : "333333",
|
256
|
+
|
257
|
+
"statuses_count" : 55066,
|
258
|
+
|
259
|
+
"following" : true,
|
260
|
+
|
261
|
+
"notifications" : false,
|
262
|
+
|
263
|
+
"profile_background_tile" : true,
|
264
|
+
|
265
|
+
"profile_use_background_image" : true,
|
266
|
+
|
267
|
+
"id_str" : "129746204",
|
268
|
+
|
269
|
+
"name" : "あるuser",
|
270
|
+
|
271
|
+
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/850998804878774272\/-yff8f6fyh.jpg",
|
272
|
+
|
273
|
+
"profile_sidebar_fill_color" : "EFEFEF",
|
274
|
+
|
275
|
+
"profile_sidebar_border_color" : "FFFFFF",
|
276
|
+
|
277
|
+
"contributors_enabled" : false,
|
278
|
+
|
279
|
+
"default_profile" : false,
|
280
|
+
|
281
|
+
"profile_banner_url" : "https:\/\/pbs.twimg.com\/profile_banners\/129746204\/1471936684",
|
282
|
+
|
283
|
+
"screen_name" : "ここがスクリーンネーム",
|
284
|
+
|
285
|
+
"time_zone" : "Tokyo",
|
286
|
+
|
287
|
+
"profile_background_image_url" : "http:\/\/pbs.twimg.com\/profile_background_images\/454304509376741376\/lTp51aDO.jpeg",
|
288
|
+
|
289
|
+
"profile_background_image_url_https" : "https:\/\/pbs.twimg.com\/profile_background_images\/454304509376741376\/lTp51aDO.jpeg",
|
290
|
+
|
291
|
+
"profile_link_color" : "F5ABB5",
|
292
|
+
|
293
|
+
"favourites_count" : 3889,
|
294
|
+
|
295
|
+
"is_translation_enabled" : false,
|
296
|
+
|
297
|
+
"translator_type" : "none",
|
298
|
+
|
299
|
+
"utc_offset" : 32400,
|
300
|
+
|
301
|
+
"friends_count" : 1233,
|
302
|
+
|
303
|
+
"verified" : false,
|
304
|
+
|
305
|
+
"has_extended_profile" : true
|
306
|
+
|
307
|
+
},
|
308
|
+
|
309
|
+
"in_reply_to_user_id" : null,
|
310
|
+
|
311
|
+
"retweeted" : false,
|
312
|
+
|
313
|
+
"text" : "ツイート本文",
|
314
|
+
|
315
|
+
"created_at" : "Fri Apr 14 04:06:46 +0000 2017",
|
316
|
+
|
317
|
+
"in_reply_to_status_id_str" : null,
|
318
|
+
|
319
|
+
"in_reply_to_status_id" : null,
|
320
|
+
|
321
|
+
"in_reply_to_user_id_str" : null,
|
322
|
+
|
323
|
+
"id_str" : "852734851786579974",
|
324
|
+
|
325
|
+
"coordinates" : null
|
326
|
+
|
327
|
+
}
|
328
|
+
|
329
|
+
]
|