IOS How to fade in and fade out a UIView while it is moving

You need to do is apply 2 animations back-to-back. So in the 1st second it will appear while moving and then in the next second it will fade out
theView.alpha = 0;
[UIView animateWithDuration:1.0
                 animations:^{
                     theView.center = midCenter;
                     theView.alpha = 1;
                 }
                 completion:^(BOOL finished){
                     [UIView animateWithDuration:1.0
                                      animations:^{
                                          theView.center = endCenter;
                                          theView.alpha = 0;
                                      }
                                      completion:^(BOOL finished){
                                          [theView removeFromSuperview];
                                      }];
                 }];

Comments

Popular posts from this blog

Java : Variables Declaring

SQL Self JOIN