Inherits from NSObject
Conforms to NSCoding
TWTRJSONConvertible
Declared in TWTRTweet.h

Overview

TWTRTweet is an immutable representation of a Tweet.

Properties

author

The Author of the Tweet.

@property (nonatomic, readonly) TWTRUser *author

Declared In

TWTRTweet.h

createdAt

The date when this Tweet was created.

@property (nonatomic, copy, readonly) NSDate *createdAt

Declared In

TWTRTweet.h

inReplyToScreenName

The screen name of the user this Tweet was a reply to.

@property (nonatomic, copy, readonly, nullable) NSString *inReplyToScreenName

Discussion

Note: This doesn’t contain the @ sign before the screen name.

Declared In

TWTRTweet.h

inReplyToTweetID

The Tweet this Tweet was a reply to.

@property (nonatomic, copy, readonly, nullable) NSString *inReplyToTweetID

Declared In

TWTRTweet.h

inReplyToUserID

The User ID this Tweet was a reply to.

@property (nonatomic, copy, readonly, nullable) NSString *inReplyToUserID

Declared In

TWTRTweet.h

isLiked

Whether this Tweet was liked by the authenticated user.

@property (nonatomic, readonly) BOOL isLiked

Discussion

Warning: The value of this property depends on the authenticated user.

Declared In

TWTRTweet.h

isQuoteTweet

Indicates whether this Tweet is a Quote Tweet.

@property (nonatomic, readonly) BOOL isQuoteTweet

Declared In

TWTRTweet.h

isRetweet

Indicates whether this Tweet is a retweet of another Tweet.

@property (nonatomic, readonly) BOOL isRetweet

Declared In

TWTRTweet.h

isRetweeted

Whether this Tweet was retweeted by the authenticated user.

@property (nonatomic, readonly) BOOL isRetweeted

Discussion

Warning: The value of this property depends on the authenticated user.

Declared In

TWTRTweet.h

languageCode

The language of the Tweet.

@property (nonatomic, copy, readonly) NSString *languageCode

Declared In

TWTRTweet.h

likeCount

The number of times this Tweet was liked.

@property (nonatomic, readonly) long long likeCount

Declared In

TWTRTweet.h

permalink

The permalink URL for this Tweet.

@property (nonatomic, copy, readonly) NSURL *permalink

Discussion

Suitable for loading in a UIWebView, WKWebView or passing to Safari:

[[UIApplication sharedApplication] openURL:tweet.permalink];

Declared In

TWTRTweet.h

perspectivalUserID

ID of the authenticated Twitter user this Tweet was loaded for. Some Tweet properties e.g. isLiked can vary depending on the authenticated user. Nil means the Tweet was loaded from the perspective of a logged-out user or the authenticated user could not be determined.

@property (nonatomic, readonly, nullable) NSString *perspectivalUserID

Declared In

TWTRTweet.h

quotedTweet

The original, fully-hydrated Tweet that was quoted. This is nil unless self.isRetweet == YES.

@property (nonatomic, readonly, nullable) TWTRTweet *quotedTweet

Declared In

TWTRTweet.h

retweetCount

The number of times this Tweet was retweeted.

@property (nonatomic, readonly) long long retweetCount

Declared In

TWTRTweet.h

retweetID

The Tweet ID of the authenticated user’s retweet of this Tweet. This will be nil if there is no authenticated user or the user has not retweeted this Tweet.

@property (nonatomic, copy, readonly, nullable) NSString *retweetID

Discussion

Warning: The value of this property depends on the authenticated user.

Declared In

TWTRTweet.h

retweetedTweet

The original, fully-hydrated Tweet that was retweeted. This corresponds to the retweeted_status API field. This is nil unless self.isRetweet == YES.

@property (nonatomic, readonly, nullable) TWTRTweet *retweetedTweet

Declared In

TWTRTweet.h

text

The text of the Tweet.

@property (nonatomic, copy, readonly) NSString *text

Declared In

TWTRTweet.h

tweetID

The ID of the Twitter Tweet.

@property (nonatomic, copy, readonly) NSString *tweetID

Discussion

Warning: This represents the id_str field, which could differ from the value of the id field.

Declared In

TWTRTweet.h

Class Methods

tweetsWithJSONArray:

Creates an array of TWTRTweet instances from the array of Twitter API JSON response.

+ (NSArray *)tweetsWithJSONArray:(nullable NSArray *)array

Parameters

array

A parsed array of Tweet API JSON responses.

Return Value

An array of TWTRTweet instances.

Declared In

TWTRTweet.h

Instance Methods

init

Tweet objects should be hyrdrated from a valid JSON object. See TWTRJSONConvertible for more information.

- (instancetype)init

Declared In

TWTRTweet.h

tweetWithLikeToggled

Creates a new Tweet instance with a new value for the isLiked boolean value which is the opposite of the current value.

- (TWTRTweet *)tweetWithLikeToggled

Declared In

TWTRTweet.h