title: View shrink ( not fade out ) using core animation
body: <p>I have subclassed a <code>UIButton</code> to make the button shape appear as a doughnut ( circle with a transparent hole in the middle ) </p>
  
  <p>The <code>drawRect</code> is : </p>
  
  <pre><code>- (void)drawRect:(CGRect)rect
  {
      [super drawRect:rect];
      if(context==nil)
      context = UIGraphicsGetCurrentContext();
  
      CGContextSetFillColorWithColor(context, [UIColor redColor].CGColor);
      CGContextSetStrokeColorWithColor(context, [UIColor colorWithRed:0 green:1.0 blue:0 alpha:0.5].CGColor);
      CGMutablePathRef path = CGPathCreateMutable();
       CGContextSetLineWidth(context, self.frame.size.width/2 - innerRadius);
  
      CGPathAddArc(path, NULL, self.frame.size.width/2.0, self.frame.size.height/2.0, (innerRadius+((self.frame.size.width/2 - innerRadius)/2.0)), 0 * 3.142/180, 2.1 *3.14, 0);
  
      CGContextAddPath(context, path);
      CGContextStrokePath(context);
      CGPathRelease(path);
  }
  </code></pre>
  
  <p>When the button is clicked,  I want the inner hole to shrink gradually and finally disappear leaving the circle whole . </p>
  
  <p><code>innerRadius</code> controls the size of the inner hole so I used the following function to try to achieve what I want : </p>
  
  <pre><code>- (void) animateButton
  {
         innerRadius = 0;
  
      [UIView transitionWithView:self duration:0.5
                         options:UIViewAnimationOptionTransitionCrossDissolve
                      animations:^{
                          [self.layer displayIfNeeded];
                      } completion:nil];
  }
  </code></pre>
  
  <p>This works but not quite like I wanted. The hole just fades out over a 0.5 second period. I want it to gradually shrink and then disappear instead. How can I achieve this using core animation ?  </p>