REST API + Fabric/Twitter + Compact TweetView Style


#1

Hi,

I am querying the REST API for statuses/user_timeline.json that I then display in a UITableView using the Fabric Twitter with the following code:

func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
      
      let tweet = self.tweets[indexPath.row]
      let cell = timelineTV.dequeueReusableCellWithIdentifier(tweetTableReuseIdentifier, forIndexPath: indexPath) as! TWTRTweetTableViewCell
      
      cell.configureWithTweet(tweet)
      cell.tweetView.delegate = self
      
      return cell

   }

The tweets display fine, with the exception if the profile images, which are missing. Just get light gray boxes.

The JSON being returned is this:

{
    contributors = "<null>";
    coordinates = "<null>";
    "created_at" = "Wed May 06 20:43:32 +0000 2015";
    entities =     {
        hashtags =         (
        );
        symbols =         (
        );
        urls =         (
        );
        "user_mentions" =         (
                        {
                id = 33537967;
                "id_str" = 33537967;
                indices =                 (
                    6,
                    19
                );
                name = "Amy Klobuchar";
                "screen_name" = amyklobuchar;
            }
        );
    };
    "favorite_count" = 0;
    favorited = 0;
    geo = "<null>";
    id = 596052698169933825;
    "id_str" = 596052698169933825;
    "in_reply_to_screen_name" = "<null>";
    "in_reply_to_status_id" = "<null>";
    "in_reply_to_status_id_str" = "<null>";
    "in_reply_to_user_id" = "<null>";
    "in_reply_to_user_id_str" = "<null>";
    lang = en;
    place = "<null>";
    "retweet_count" = 0;
    retweeted = 0;
    source = "<a href=\"http://www.cloudhopper.com/\" rel=\"nofollow\">Cloudhopper</a>";
    text = "WHOIS @amyklobuchar to view profile.";
    truncated = 0;
    user =     {
        "contributors_enabled" = 0;
        "created_at" = "Thu Mar 31 03:11:08 +0000 2011";
        "default_profile" = 1;
        "default_profile_image" = 0;
        description = "iOS & OS X Developer with fullstack experience; Learning AWS & Hadoop ecosystem";
        entities =         {
            description =             {
                urls =                 (
                );
            };
        };
        "favourites_count" = 47;
        "follow_request_sent" = "<null>";
        "followers_count" = 80;
        following = "<null>";
        "friends_count" = 313;
        "geo_enabled" = 0;
        id = 274829182;
        "id_str" = 274829182;
        "is_translation_enabled" = 0;
        "is_translator" = 0;
        lang = en;
        "listed_count" = 2;
        location = danauerbach;
        name = "Dan Auerbach";
        notifications = "<null>";
        "profile_background_color" = C0DEED;
        "profile_background_image_url" = "http://abs.twimg.com/images/themes/theme1/bg.png";
        "profile_background_image_url_https" = "https://abs.twimg.com/images/themes/theme1/bg.png";
        "profile_background_tile" = 0;
        "profile_image_url" = "http://pbs.twimg.com/profile_images/1740399232/DanWarholSingleRed_normal.jpg";
        "profile_image_url_https" = "https://pbs.twimg.com/profile_images/1740399232/DanWarholSingleRed_normal.jpg";
        "profile_link_color" = 0084B4;
        "profile_sidebar_border_color" = C0DEED;
        "profile_sidebar_fill_color" = DDEEF6;
        "profile_text_color" = 333333;
        "profile_use_background_image" = 1;
        protected = 0;
        "screen_name" = dadsoup;
        "statuses_count" = 976;
        "time_zone" = "Pacific Time (US & Canada)";
        url = "<null>";
        "utc_offset" = "-25200";
        verified = 0;
    };
}

Which seems to have the profile URLs available. I don’t see that there is anything special I can do regarding these images.

Is there some trick to having these get pulled in and displayed after called cell.configureWithTweet(tweet)?

Many thanks,
Dan


#2

So sorry… user (my) error.

I had commented out the Fabric/Twitter initialization in my AppDelegate while debugging something else and forgot to re-enable. So the I assume Fabric wasn’t able to retrieve images without the key/secret being initialized.

Cheers,
dan


#3