cs193p – Project #4 Assignment #4 Extra Task #1

By http://www.flickr.com/photos/txberiu/7875325192/in/faves-abaransk/ Tiberiu Ana [CC BY 3.0 (http://creativecommons.org/licenses/by/3.0)], via Wikimedia Commons

Please note, this blog entry is from a previous course. You might want to check out the current one.

In the Users section of your new UITableViewController, list not only users mentioned in the Tweet, but also the user who posted the Tweet in the first place.

Add the users screen name including a leading @ sign:

    var tweet: Tweet? {
        didSet {
            ...
            if let users = tweet?.userMentions {
                var userItems = [MentionItem.Keyword("@" + tweet!.user.screenName)]
                if users.count > 0 {
                    userItems += users.map { MentionItem.Keyword($0.keyword) }
                }
                mentions.append(Mentions(title: "Users", data: userItems))
            }
        }
    }

The complete code for extra task #1 is available on GitHub.

Facebooktwittergoogle_plusredditpinterestlinkedintumblrmailFacebooktwittergoogle_plusredditpinterestlinkedintumblrmail

Flattr this!

Leave a Reply

Your email address will not be published. Required fields are marked *