1

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];
             }];
Serge
  • 2,031
  • 3
  • 33
  • 56

1 Answers1

5

According to the answer to my question you can't animate CALayer properties in a UIView block.

Community
  • 1
  • 1
Robert Atkins
  • 23,528
  • 15
  • 68
  • 97