cs193p – Assignment #4 Task #7

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

Animate re-deals.

The adding new cards part has already been handled by the previous task. Just animate the removal of the old cards by moving them to the bottom left corner:

- (IBAction)touchDealButton:(UIButton *)sender {
    ...
    for (UIView *subView in self.cardViews) {
        [UIView animateWithDuration:0.5
                         animations:^{
                             subView.frame = CGRectMake(0.0,
                                                        self.gridView.bounds.size.height,
                                                        self.grid.cellSize.width,
                                                        self.grid.cellSize.height);
                         } completion:^(BOOL finished) {
                             [subView removeFromSuperview];
                         }];
    }
    ...
}

The complete code is available on github.

Facebooktwittergoogle_plusredditpinterestlinkedintumblrmailFacebooktwittergoogle_plusredditpinterestlinkedintumblrmail

Flattr this!

Leave a Reply

Your email address will not be published. Required fields are marked *