0
votes

I subclasses UIButton to create my own UIRoundButton. I'm trying to animate a custom property called radius. It does change, but it does immediately. I tried to increase the animation duration until 5000 but the animation is still happening in a millisecond.

Here is the code:

UIRoundButton *tempItem = [self.buttons objectAtIndex:currentElement];
[tempItem setInnerColor:UIColorFromRGB(0xcdcdcd)];

currentElement = currentElement + 1;
UIRoundButton *tempItem2 = [self.buttons objectAtIndex:currentElement];
[tempItem2 setInnerColor:UIColorFromRGB(0xff0000)];

[UIView beginAnimations:@"ToggleViews" context:nil];
[UIView setAnimationDuration:5000];
tempItem.radius = 20;
tempItem2.radius = 40;
[UIView commitAnimations];

Any idea?

1

1 Answers

1
votes

Implicit view animations don't work on custom properties. You have to do this at the CALayer level if you want this kind of behavior.