UITableView animation resize

Im using the following code to spice up the resizing UITableView

to create a way UIView

with additional controls when UITableView.isEditing.

[UIView animateWithDuration:3 // 0.2 but slowed down to easily see difference
                      delay:0
                    options:UIViewAnimationOptionCurveEaseOut 
                 animations:^{
                     [self.selectControlsView setFrame:CGRectMake(0, self.tableView.frame.size.height-self.selectControlsView.frame.size.height, self.selectControlsView.frame.size.width, self.selectControlsView.frame.size.height)];
                     [self.tableView setFrame:CGRectMake(0, 0, self.tableView.frame.size.width, self.tableView.frame.size.height-self.selectControlsView.frame.size.height)];
                 }
                 completion:nil];

      

This works great, but it seems like the animation UITableView

is faster than UIView

(even if I adjust the UIViews frame in front of the frame UITableViews

) causing black flickering during animation from the background.

Is there a way to animate two views in tandem?

+3


source to share


1 answer


The problem was caused by the controller being a subclass of UITableViewController. Now I subclass UIViewController and add UITableView as subview, animation for adding new view and resizing UITableView now works as expected.



0


source







All Articles