Skip to content

Instantly share code, notes, and snippets.

@mpociot
Created February 10, 2012 10:09
Show Gist options
  • Save mpociot/1788369 to your computer and use it in GitHub Desktop.
Save mpociot/1788369 to your computer and use it in GitHub Desktop.
simplified button animation
- (IBAction)btn_reg_onClick:(id)sender {
reg_animation_modus = !(reg_animation_modus);
int k;
if( reg_animation_modus ){
k = 1;
[btn_einloggen setTitle:@"Registrieren" forState:UIControlStateNormal];
} else {
k = -1;
[btn_einloggen setTitle:@"Einloggen" forState:UIControlStateNormal];
}
[UIView animateWithDuration:1.0 animations:^{
CGRect frame = btn_einloggen.frame;
frame.origin.y += key_max_reg_animation_count * k;
btn_einloggen.frame = frame;
frame = tf_pw_r.frame;
frame.origin.x += (key_max_reg_animation_count*30) * k;
tf_pw_r.frame = frame;
}];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment