Question: My goal is simple and I have achieved this previously which is why I'm resorting to asking my question here.

I am trying to animate a subview. Simple enough. The view ends up exactly where I want it to be after the animation is over. The only problem is:
whatever I do the animation duration is completely ignored. It happens instantly.

```
- (void)callToDismissView:(UIView *)view {

     [self.view addSubview:view];

     [self dismissViewControllerAnimated:NO completion:nil];

     [UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^(void){

         CGRect frame = self.view.frame;
         frame.origin.x = frame.size.width;
         view.frame = frame;

     } completion:^(BOOL finished){

         [view removeFromSuperview];
     }];
 }

```

Now I have tried different frames and durations to see if the view was animated at all and it always ends up where I need it to be. Only instantly...

**EDIT:**

The above code is being called by a delegate in the dismissed view controller like so:

```
- (void)dismissSelf {

    if (self.delegate && [self.delegate respondsToSelector:@selector(callToDismissScan)]) {

        [self.delegate callToDismissScan];
    }
}

```

And that method itself is triggered by a notification.

I must admit that some things are happening during the transition between the two controllers that I don't fully understand. (And I would very much like to understand them...)

Answer: 
You can try 
[self.view layoutIfNeeded];

like this

```
- (void)callToDismissView:(UIView *)view {

 [self.view addSubview:view];

 [self dismissViewControllerAnimated:NO completion:nil];
 [self.view layoutIfNeeded];
 [UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^(void){

     CGRect frame = self.view.frame;
     frame.origin.x = frame.size.width;
     view.frame = frame;
     [self.view layoutIfNeeded];

 } completion:^(BOOL finished){

     [view removeFromSuperview];
 }];
 }

```
It seems there was no way in hell I could animate the transition in the presenting view controller and so the simplest way to resolve the issue was to animate the transition in the presented view controller before it is being dismissed.
The way I did this was by casting the delegate to a view controller. It was then easy to add it's view as a sub-view of my presented view controller and animate it like so:

```
- (void)dismissSelf {

    UIView *dummyView = [ScreenCapper captureScreenIn: self];
    UIViewController *presentingViewController = (UIViewController *)self.delegate;
    [self.view.window addSubview: presentingViewController.view];
    [self.view.window addSubview: dummyView];

    [UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^(void){

        dummyView.frame = CGRectMake(dummyView.frame.size.width, dummyView.frame.origin.y, dummyView.frame.size.width, dummyView.frame.size.height);

    } completion:^(BOOL finished){
        if (self.delegate && [self.delegate respondsToSelector:@selector(callToDismissView)]) {

            [self.delegate callToDismissView];
        }
    }];
}

```

And in the presenting view controller all that was left to do was to dismiss the presented view controller without animations.

```
- (void)callToDismissView {

    [self dismissViewControllerAnimated:NO completion:nil];
}

```