Try the search, it's linked to some great forums

Monday, April 18, 2011

View Transitions CGAffine & animateWithDuration Animation Blocks

don't forget to set options to:UIViewAnimationOptionAllowUserInteraction to allow operation of buttons & other controls.
The following snippet provides a multiple move/scale transition for a view, label, whatever;
 Moves a label & scales to 50%
     - (void)transformTime        //performs scale & translate transition
    {
                CGAffineTransform transformTranslate = CGAffineTransformMakeTranslation(-330.0, 15.0);
                CGAffineTransform transformScale = CGAffineTransformMakeScale(0.5, 0.5);
                CGAffineTransform transformClock = CGAffineTransformConcat(transformScale, transformTranslate);
               [self.clockLabel setTransform:transformClock];
               [self.dateLabel setTransform:CGAffineTransformMakeTranslation(-330.0, 0.0)];
    }

Performs the animations a Fade In/Out and a Move/Scale AffineTransform
// transitions to weather OR forecast
    if ([sender.titleLabel.text isEqualToString:@"Weather"]) {
        if (!weatherShowing) {
            self.weatherView.center = CGPointMake(512.0, 618.0);
            weatherShowing = YES;
            weatherButton.selected = YES;
            clockShowing = YES;
            radioShowing = NO;
            forecastShowing = NO;       
            [UIView animateWithDuration:1.5 delay:1.0          // Fading of views
                                options:UIViewAnimationOptionAllowUserInteraction   
                                animations:^{
                                         self.weatherView.alpha = 1.0;
                                         self.radioView.alpha = 0.0;
                                         self.forecastView.alpha = 0.0;
                             }
                             completion: NULL];   
           
            [UIView animateWithDuration:1.5 delay:0.0         // transform of clock label
                                options:UIViewAnimationOptionAllowUserInteraction
                             animations:^{
                                 [self transformTime];
                             }
                             completion: NULL];