LisonFan LisonFan - 1 year ago 62
iOS Question

About 'beginAnimations' and 'commitAnimations'

I added in the button click event:

[UIView beginAnimations:nil context:nil];
sender.titleLabel.font = [UIFont systemFontOfSize:18];
[UIView commitAnimations];

The animation is not working. But if I remove
[UIView commitAnimations];
, the animation works. Why?

If I don't add
[UIView commitAnimations];
, what will happen?

Answer Source

Why you are not using this for view animations?

[UIView animateWithDuration:1.0 animations:^{
    // place your animations code here

Note: please visit this url and see the section What can be animated. Only few properties can be used for animations

Try this, it will help. In the example below, viewObject may be label in your case.

[UIView animateWithDuration:1.0 animations:^{
    viewObject.transform = CGAffineTransformMakeScale(1.5, 1.5);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download