Please note, this blog entry is from a previous course. You might want to check out the current one.
Do something sensible when no more cards are in the deck and the user requests more.
There a various “sensible” solutions, lets just disable the button and gray it out, when there are no cards left in the deck:
- (IBAction)addCardsButtonPressed:(UIButton *)sender { ... if (self.game.deckIsEmpty) { sender.enabled = NO; sender.alpha = 0.5; } }
Continue reading “cs193p – Assignment #3 Task #9”