I need to handle a case where you can do something with or without animation, instead of:
if (animation)
{
[UIView animateWithBlock:^(){...}];
}
else
{
...
}
I want to do:
[UIView animateWithBlock:^(){...} duration:(animation ? duration : 0)]
but not sure if it works, even if it does, is there any overhead for using this instead of directly change the view?
Thanks
Yes, since the duration is zero, the transition will effectively by instantaneous.