cs193p – Assignment #4 Task #4

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

As in a real game of Set, the user should start with 12 cards and then have the option of requesting 3 more cards to be dealt at any time if he or she is unable to locate a Set. Do something sensible when there are no more cards in the deck.

Add a new button in storyboard and set its tag to 3 (the number of cards that should be added):

cs193p – assignment #4 task #4 – add cards button
cs193p – assignment #4 task #4 – add cards button

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

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

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 – Lecture #10 – Multithreading, Scroll View

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

Lecture #10 starts with an introduction on multithreading mainly on how to run lengthy tasks in parallel to avoid blocking. iOS supports different APIs – where the last courses emphasized on the C-styled API this year the Objective-C API seems to be preferred.

The second part of the theory addresses scroll views, on how to create them, scrolling and zooming.

The rest of the lecture is devoted to a demonstration of multithreading and scroll views.

The code for this lecture is available at gitub. Stanford has not updated its homepage yet, I assume it will be available in short time.

The lecture as well as its slides are available via iTunes called “10. Multithreading, Scroll View”.

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Lecture #9 – Animation and Autolayout

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

Lecture #9 starts with a demo continuing the dropit app from the previous lecture.

The rest of the lecture is devoted to autolayout and different ways how constraints can be defined followed by another short demonstration.

The code for this lecture is available at github for dropit and attributor as well as from Stanford.

The lecture as well as its slides are available via iTunes called “9. Animation and Autolayout”.

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Lecture #8 – Protocols, Blocks, and Animation

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

Though lecture #8 starts with a huge theory part.

Protocols are a way of communication between unrelated projects, in iOS mainly used for delegates and data sources. A protocol declares which properties and methods can or have to exist in another class to be accessible by the declaring class.

Blocks encapsulate pieces of code which can be passed like objects. Special care has to be taken when the code inside blocks needs to access variables or objects outside the block.

Animating views can be done by animating its properties directly or – new in iOS 7 – physics based. When animating the properties of a view you provide the timing and the end state. For dynamic animation you define the physics of your view and its contents.

The end of the lecture is a demo explaining dynamic animation in more detail.

The code for this lecture is available at github as well as from Stanford.

The lecture as well as its slides are available via iTunes called “8. Protocols, Blocks, and Animation”.

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail