Twitter api 文本字段值被截断

为什么文本字段值被截断,以及如何获得完整的值。 现在我正在尝试得到文本字段的值,如下所示

do {
if let responseObject = try NSJSONSerialization.JSONObjectWithData(response, options: []) as? [String:AnyObject],
arrayStatuses = responseObject["statuses"] as? [[String:AnyObject]] {
let arrTweets:NSMutableArray = NSMutableArray()
for status in arrayStatuses {
let text = status["text"]!
print(status["text"]!)
}
}
}

输出是

俄罗斯/印度可能在今年年底发射布拉莫斯巡航导弹,从苏 -30MKI 对海/陆导弹。 https://..。

行尾处三个点。我需要打印没有截断的完整文本。

Twitter 示例搜索结果 JSON 数据

{
"created_at": "Mon Aug 01 08:07:43 +0000 2016",
"id": 760024194079916032,
"id_str": "760024194079916032",
"text": "RT @khalidasopore: #KEXIT #KASHEXIT #KashmirKillings #Inida #Pakistan Just trend it my dear Indians to save #Kashmir from Pak Goons https:/…",
"truncated": false
}
39211 次浏览

The Twitter API has been changed recently, to support new rules regarding the 280 characters limit.

  1. To get the full text of the tweet, add parameter tweet_mode with value extended to your request parameters.
  2. Field text in the JSON response has been replaced by full_text

More info here: https://dev.twitter.com/overview/api/upcoming-changes-to-tweets

The status in this example is a retweet, and the text for retweets will be truncated to 140 characters even after including tweet_mode=extended. The full text of the original tweet is in the retweeted_status field of the JSON response. Here's what you want:

let text = status["retweeted_status"]["full_text"].

Keep in mind that you should still include tweet_mode=extended in your request.