Note that there are some explanatory texts on larger screens.

plurals
  1. POProblems with transitionWithView and animateWithDuration
    primarykey
    data
    text
    <p>I have problems with <code>transitionWithView</code> and <code>animateWithDuration</code>. One of my <code>animateWithDuration</code> blocks doesn't transition, it is a sudden change, and <code>transitionWithView</code> does not temporarily disable user interaction. I have checked the docs and believe I am doing everything correctly, but obviously something is wrong. Here are the two blocks of code:</p> <p>This is in my main View Controller <code>ViewController</code> which has three container views/child view controllers. This block moves one of the container views, but does not block the user from other interactions in <code>ViewController</code> while the transition is occurring.</p> <pre><code>[UIView transitionWithView:self.view duration:0.5 options:UIViewAnimationOptionCurveEaseOut animations:^ { CGRect frame = _containerView.frame; frame.origin.y = self.view.frame.size.height - _containerView.frame.size.height; _containerView.frame = frame; }completion:^(BOOL finished) { // do something }]; </code></pre> <p>This is in one of my container view controllers. The animation seems to have no effect as the text of the <code>productTitleLabel</code> and <code>productDescriptionTextView</code> changes suddenly as if the animation block does not exist.</p> <pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [self.viewController toggleFlavoredOliveOilsTableView]; if (indexPath.row &gt; 0) { NSDictionary *selectedCellDict = [[_flavoredOliveOilsDict objectForKey:@"Unflavored Olive Oils"] objectAtIndex:indexPath.row - 1]; [UIView animateWithDuration:0.5 delay:0 options:UIViewAnimationOptionTransitionCrossDissolve animations:^ { self.viewController.productTitleLabel.text = [_flavoredOliveOilsTableView cellForRowAtIndexPath:indexPath].textLabel.text; self.viewController.productDescriptionTextView.text = [selectedCellDict objectForKey:@"Description"]; }completion:nil]; if (indexPath.row == 1) { [self.viewController setProductDescriptionTextViewFrameForInformationTab]; } else { [self.viewController setProductDescriptionTextViewFrameForNonInformationTab]; //self.viewController.productImageView.image = [UIImage imageNamed:[selectedCellDict objectForKey:@"Image"]]; } } } </code></pre> <p>I think the problems are somewhat related as most of my animation and transition blocks don't work completely as expected. Thanks for any help.</p> <p><strong>Edit</strong></p> <p>What I am trying to accomplish is moving a container view in <code>ViewController</code> and set the text and image properties of a label, text view, and image view; all of which are in the main view. The details of these properties are sent via the child view controller. The <code>transitionWithView</code> is in a method called <code>toggleFlavoredOiveOilsTableView</code> which is called in <code>didSelectRowAtIndexPath</code>. I think the problem is that I am trying to call two different animation/transition blocks at the same time.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload