Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)updateBoard {
- self.allowInteract = NO;
- [UIView animateWithDuration:0.3
- animations:^{
- for (int i = 0, j = 0; i < self.boardView.subviews.count; i++) {
- CardView *view = self.boardView.subviews[i];
- if ([self.cardViewsToRemove containsObject:view]) {
- view.center = [self centerBoundaryPositionOfView:view];
- continue;
- }
- NSUInteger row = j / self.grid.columnCount;
- NSUInteger column = j % self.grid.columnCount;
- CGRect frame = [self.grid frameOfCellAtRow:row inColumn:column];
- view.frame = frame;
- j++;
- }
- }
- completion:^(BOOL finished) {
- for (UIView *view in self.cardViewsToRemove) {
- [view removeFromSuperview];
- }
- [self.cardViewsToRemove removeAllObjects];
- self.pinched = NO;
- self.allowInteract = YES;
- }];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement