getFollowing(__userFields_tweetFields_paginationToken_maxResults_) - daneden/Twift GitHub Wiki

getFollowing(_:userFields:tweetFields:paginationToken:maxResults:)

Returns a list of users the specified user ID is following.

public func getFollowing(_ userId: User.ID,
                           userFields: [User.Fields] = [],
                           tweetFields: [Tweet.Fields] = [],
                           paginationToken: String? = nil,
                           maxResults: Int = 100
  )

Equivalent to GET /2/users/:id/following.

Parameters

  • userId: The user ID whose following you would like to retreive.
  • userFields: This fields parameter enables you to select which specific user fields will deliver with each returned user objects. These specified user fields will display directly in the returned user struct.
  • tweetFields: This fields parameter enables you to select which specific Tweet fields will deliver in each returned pinned Tweet. The Tweet fields will only return if the user has a pinned Tweet. While the referenced Tweet ID will be located in the original Tweet object, you will find this ID and all additional Tweet fields in the includes property on the returned TwitterAPIDataIncludesAndMeta struct.
  • paginationToken: When iterating over pages of results, you can pass in the nextToken from the previously-returned value to get the next page of results
  • maxResults: The maximum number of results to fetch.

Returns

A Twitter API response object containing an array of User structs and any pinned tweets in the includes property