cs193p – Assignment #4 Task #3

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

When a Set match is successfully chosen, the matching cards should now be removed from the game (not just blanked out or grayed out, but removed from the UI entirely).

When looping of the cards check if it matches, if it does remove it from the super view and form the view array. Before creating a new view check, if the cared has already matched earlier, to avoid recreating its view:
Continue reading “cs193p – Assignment #4 Task #3”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Assignment #4 Task #2

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

Cards must have a “standard” look and feel (i.e. for Set, 1, 2 or 3 squiggles, diamonds or ovals that are solid, striped or unfilled, and are either green, red or purple; for Playing Cards, pips and faces). You must draw these using UIBezierPath and Core Graphics functions. You may not use images or attributed strings for Set cards. The drawings on the card must scale appropriately to the card’s bounds. You can use the PlayingCardView from the in-class demo to draw your Playing Card game cards.

… the cleaning continues: Remove all card buttons from your storyboard, as well as their outlet collection property and every reference to it in your code. Because the cards will now drawn remove also the methods to update the button title and background images … like before, you can leave the code parts where the are, but it might get crowded …
Continue reading “cs193p – Assignment #4 Task #2”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Assignment #4 Task #1

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

Your application this week is still required to play both the Set and Playing Card matching games (in separate tabs) and must show the score and allow re-deals, but you can remove the UI for showing the result of the last card choice as well as the History MVC added last week.

From your storyboard remove the history view controller as well as the navigation view controllers. Relink both game view controllers with the tab view controllers. Finally remove the flip-description labels:

cs193p – assignment #4 task #1 – cleanup
cs193p – assignment #4 task #1 – cleanup

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

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.

Make your application work on the iPad as well with appropriate user-interface idioms on that platform. This will require you to have absorbed the lecture immediately after this was assigned. But you’ll be asked to do this next week anyway, so you’ll be ahead of the game if you do it this week (and get a little bit of extra credit for doing it early).

In the iPad storyboard remove the default controller. Drag out a new split-view controller. Remove the default master and detail views. Go to the iPhone storyboard copy every thing and paste it to the Pad storyboard. Set the tab-view controller to be the master view controller. Remove the segues pointing to the image view controller and set the image view as detail view controller:

cs193p - assignment #4 extra task #2
cs193p – assignment #4 extra task #2

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.

Show your lists sorted alphabetically. There are two methods that might be helpful in this: sortedArrayUsingSelector: and sortedArrayUsingDescriptors:. The former is good when you have an array of NSString objects. The latter is good when you have an array of NSDictionary objects (and you want to sort by one of the values in the dictionaries).

… actually use both! The first one to sort the tags:

- (NSString *)tagForRow:(NSUInteger)row
{
    return [[self.photosByTag allKeys] sortedArrayUsingSelector:@selector(compare:)][row];
}

The second one to sort the photos by name:

- (void)setPhotos:(NSArray *)photos
{
    _photos = [photos sortedArrayUsingDescriptors:@[[[NSSortDescriptor alloc] initWithKey:FLICKR_PHOTO_TITLE ascending:YES]]];
    [self.tableView reloadData];
}

The complete code is available on github.

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Assignment #4 Task #9 & #10

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

Since all the lists you display allow further navigation, they should display a disclosure indicator in every cell (Xcode will automatically add this for you when you create a segue from a table view cell).

… if you would like to adjust it yourself you could do so in storyboard using the inspector to set the accessory to disclosure indicator, or set it in code:

cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;

This application must work properly in both portrait and landscape modes on the iPhone 4 and iPhone 5. It is extra credit to also do the iPad, but the iPhone version is required.

… it does 😉

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Assignment #4 Task #8

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

The recents tab must show a list of the most recently view photos in order, with the most recent at the top and no duplicates in the list. The list of recents must also persist across application termination and relaunch. When a recent photo in the list is chosen, it should navigate to a view of the photo in the same way as other table views in the application do. Limit the size of the list to a reasonable number.

Create a new class derived from NSObject to handle saving and storing the recent photos. Create a public interface to get all photos and to set a new photo:

+ (NSArray *)allPhotos;
+ (void) addPhoto:(NSDictionary *)photo;

Continue reading “cs193p – Assignment #4 Task #8”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail