Reputation: 2129
I try to make fade in/out effect for UIView border but it does'nt work. When try to do the following effect for background color it works perfectly. Here is a code I developed:
[UIView animateWithDuration:3.0f
animations:^ {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.5];
self.layer.borderColor = [[UIColor redColor] CGColor];
self.layer.borderWidth = 1.5f;
[UIView commitAnimations];
}
completion:^(BOOL finished){
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.8];
self.layer.borderColor = [[UIColor whiteColor] CGColor];
self.layer.borderWidth = 1.5f;
[UIView commitAnimations];
}];
Upvotes: 1
Views: 1896
Reputation: 24688
According to the answer to my question you can't animate CALayer properties in a UIView block.
Upvotes: 5