cs193p – Project #4 Assignment #4 Task #3

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

Each section in the mentions table view should have an appropriate header.

We store already the title in our data structure, now just use it:

    override func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
        return mentions[section].title
    }

The complete code for task #3 is available on GitHub.

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Project #4 Assignment #4 Task #2

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

When a user clicks on a Tweet, segue to a new UITableViewController which has four sections showing the “mentions” in the Tweet: Images, URLs, Hashtags and Users. The first section displays (one per row) any images attached to the Tweet (found in the media variable in the Tweet class). The last three show the items described in Required Task 1 (again, one per row).

Add a new table view controller to story board and a new table-view-controller class which you link to the new controller. Add a segue from the tweet cell too the new controller (don’t forget to add a segue identifier).
Continue reading “cs193p – Project #4 Assignment #4 Task #2”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Project #4 Assignment #4 Task #1

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

Enhance Smashtag from lecture to highlight (in a different color for each) hashtags, urls and user screen names mentioned in the text of a Tweet (these are known as “mentions”). Note that mentions are already located for you in each Tweet by Twitter and show up as [IndexedKeyword]s in the Tweet class in the supplied Twitter code.

The tweet class provides nearly everything needed – arrays of indexed keywords. What’s left is to choose a color for the keyword type – as public properties of the cell view:

    var hashtagColor = UIColor.blueColor()
    var urlColor = UIColor.redColor()
    var userMentionsColor = UIColor.greenColor()

Continue reading “cs193p – Project #4 Assignment #4 Task #1”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Assignment #4 Extra Task #4

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

Think of some other way(s) to use animation in your application and implement it.

What happens if you shake your iPhone? The card go crazy:
Continue reading “cs193p – Assignment #4 Extra Task #4”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Assignment #4 Extra Task #3

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

Make the Set game a two player game. There’s no need to go overboard here. Think of a simple UI and a straightforward implementation that make sense.

In storyboard dublicate the set-game view controller, add a now image for the tab bar and remove the cheat button (we did not add a penalty for cheating in task #2 and it would be unfair for the two player game 😉 ) – and of course link it to the tab view contorller:

cs193p – assignment #4 extra task #3 – two-player view controller
cs193p – assignment #4 extra task #3 – two-player view controller

Continue reading “cs193p – Assignment #4 Extra Task #3”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Assignment #4 Extra Task #2

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

Knowing how to find Sets in the remaining cards also would allow you to let the user cheat. Have a button that will show them a Set (if available). It’s up to you how you want to show it, but maybe some little indicator (a star or something) on each of the 3 cards?

Add a new button to storyboard:

cs193p – assignment #4 extra task #2 – cheat button
cs193p – assignment #4 extra task #2 – cheat button

… and link to an action which stores a possible combination in a new property:
Continue reading “cs193p – Assignment #4 Extra Task #2”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Assignment #4 Extra Task #1

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

You could add better score-keeping to the Set part of this application if you can figure out an algorithm for calculating whether a Set exists in the current cards in play. Then you can penalize the user not only for mismatches, but for clicking the “deal 3 more cards” button if he or she missed a Set. You’d also know when the game was “over” (because the user would click on “deal 3 more cards” and there would be no more cards in the deck and no more Sets to choose).

The game model needs a new public method returning matching cards. For this task a method returning a boolean result would be sufficient, but we will use the same method for the next task:

- (NSArray *)findCombination;

Continue reading “cs193p – Assignment #4 Extra Task #1”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail