objective-c ios uibutton beginanimations

objective c - La animación de UIView cambia el tamaño del botón



objective-c ios (1)

¿Estás apuntando a un iOS que no admite Blocks?

Implementé un "botón se anima al tocar" usando el siguiente código nauseatingly simple.

[UIView animateWithDuration:0.5 animations:^{ self.navigationItem.rightBarButtonItem.title = @"Quoting..."; }];

Alternativamente, este código parece funcionar también para animar un botón al tacto, si no puede admitir bloques (también incluye los bloques comentados si sigue esa ruta):

-(IBAction) clicked:(UIButton*)sender{ [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:0.5]; [UIView setAnimationDelay:0]; [UIView setAnimationCurve:UIViewAnimationCurveEaseIn]; //[UIView animateWithDuration:2.5 animations:^{ sender.autoresizesSubviews = NO; sender.clipsToBounds = NO; sender.frame = CGRectMake(63,326,200,37); //sender.frame = CGRectMake( CGRectGetMinX( self.theButton.frame) - 100, CGRectGetMinY(self.theButton.frame), 300, 40); //[sender setTitle:@"Touched Touched Touched" forState:UIControlStateNormal]; //}];

Empecé a tratar de recrear el botón de compra de la tienda de aplicaciones que requiere un clic de 2 etapas para comprar algo. Yo para animar el botón de expansión. Hasta ahora tengo esto

[UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:0.75]; sender.autoresizesSubviews = NO; sender.clipsToBounds = NO; sender.frame = CGRectMake(63,326,200,37); [UIView commitAnimations];

que solo hace que el botón se agrande, no se anima en absoluto. ¿He hecho algo mal o alguien más ha implementado este tipo de comportamiento de botón?

EDITAR:

- (IBAction) buyButtonAction: (UIButton *) sender { [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:1.5]; [UIView setAnimationDelay:0.5]; [UIView setAnimationCurve:UIViewAnimationCurveEaseIn]; sender.clipsToBounds = NO; sender.frame = CGRectMake( CGRectGetMinX( sender.frame) - 30, CGRectGetMinY(sender.frame), 200, 37); [sender setTitle:@"Touched Touched Touched" forState:UIControlStateNormal]; [UIView commitAnimations]; }