cs193p – Assignment #3 Task #8

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

Automatically scroll to show any new cards when you add some in the Set game.

After a the data has been reloaded scroll to the last item:

- (IBAction)addCardsButtonPressed:(UIButton *)sender {
    ...    
    [self.cardCollectionView scrollToItemAtIndexPath:[NSIndexPath indexPathForItem:(self.game.numberOfCards - 1) inSection:0]
                                    atScrollPosition:UICollectionViewScrollPositionBottom
                                            animated:YES];
}

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 *