Monday, 22 June 2015

Animate a frames, After Load a Function in iOS

.m File:
-(IBAction)clicked_Language:(id)sender
{
    [UIView animateWithDuration:1.2f delay:0.0f options:UIViewAnimationOptionTransitionFlipFromRight animations:^
     {
         logo.frame = CGRectMake(180, 80, 215, 170);
         btn.frame = CGRectMake(180, 259, 228, 55);
         
     } completion:^(BOOL isDone)
     {
         if (isDone)
         {
             [self load_languages];
         }
     }];
}

-(void)load_languages
{
    //view_logo.frame = CGRectMake(53, 80, 215, 170);
    
    btn.alpha = 1;
    [UIView beginAnimations:@"animateTableView" context:nil];
    [UIView setAnimationDuration:0.5];
    btn.alpha = 0;
    [UIView commitAnimations];
    btn.hidden = YES;
    
    view_table.hidden = NO;
    view_table.alpha = 0;
    view_table.frame = CGRectMake(btn.frame.origin.x, btn.frame.origin.y+5, 300, 300);
    [UIView beginAnimations:@"animateTableView" context:nil];
    [UIView setAnimationDuration:1.2];
    view_table.alpha = 1;
    [UIView commitAnimations];
    
    [table_language reloadData];
}

No comments: