Hi, first of all, I know this is a really dumb question. I have no experience at UIAnimation, so I grabbed it for a long time. I'm creating an application in which the viewcontroller contains a lot of views. Regardless of whether they are in the table, but, for example, if I clicked which is in the 20th position. Therefore, after clicking, the selected view is automatically moved using ANIMATION to the first place and the view that was first moved to the second ANIMATION position. I'm trying something like that. But the animation is fast and not beautiful. I need an easy way to do this. Thanks at Advance
NSArray *selectedCellIndices = [self.gView indicesOfSelectedCells];
NSMutableArray *numbersToDelete = [NSMutableArray array];
for (NSNumber *indexToDelete in selectedCellIndices)
[numbersToDelete addObject:[self.numbers objectAtIndex:[indexToDelete integerValue]]];
[self.numbers removeObjectsInArray:numbersToDelete];
[self.gView deleteCellsAtIndices:selectedCellIndices animated:YES];
NSNumber *newNumber = [numbersToDelete objectAtIndex:0];
[self.numbers insertObject:newNumber atIndex:0];
[self.gView insertCellAtIndex:0 animated:YES];
For animation I use something like this
[UIView animateWithDuration:0.30f delay:i*0.03f options:UIViewAnimationOptionCurveEaseInOut animations:^{
CGRect frame = cell.frame;
frame.origin = newOrigin;
if (CGRectGetMaxY(cell.frame) - (newOrigin.y+CGRectGetHeight(self.bounds)) > CGRectGetHeight(self.bounds))
frame.origin.y = CGRectGetMinY(cell.frame) - (CGRectGetHeight(self.bounds)+CGRectGetHeight(cell.frame));
cell.frame = frame;
} completion:^(BOOL finished) {
if (index != finalCellIndex)
return;
completionBlock();
}];