cs193p – Lecture #9 – Scroll View and Table View

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

Lecture #9 starts with an update concerning the view-controller lifecycle. Where pre-Autolayout you would have used viewWillAppear: for geometry based initialization, you should now use viewDidLayoutSubviews: because the first is called only when a view appears on screen and the later each time the bounds of of self.view change.

This is followed by a thorough introduction to scroll and table views. The second half of the lecture demonstrates both by populating a table view with information of photos from Flickr and to display them in a scroll view.

The code of the demo is available at Stanford and on github.

Slides are available on iTunes …..

The lecture is available at iTunes and is named “9. Scroll View and Table View (February 5, 2013)”.

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Assignment #3 Extra Task #6

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

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

Create a new property to hold the separate scores of the players and another one to know the current player:

@property (strong, nonatomic) NSMutableArray *playerScores; // of NSNumber
@property (nonatomic) int currentPlayer;
...
- (NSMutableArray *)playerScores
{
    if (!_playerScores) {
        _playerScores = [NSMutableArray arrayWithObjects:@0, @0, nil];
    }
    return _playerScores;
}

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

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Assignment #3 Extra Task #5

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?

Start by adding a new button in storyboard:

cs193p - assignment #3 extra task #5
cs193p – assignment #3 extra task #5

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

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail