title: adding 'click' effect on UIButton
body: <p>i have a <code>UIButton</code> that when I tap it, goes down giving effect of a <code>click/tap</code>. </p>
  
  <p><img src="https://i.stack.imgur.com/yR22x.gif" alt="example"></p>
  
  <p>My problem is that I have to add a <code>black border</code> around <code>UIButton</code>, but adding this keeps border static and it doesn't move down with the <code>UIButton</code>, the code that let me have click effect on <code>UIButton</code> is this: </p>
  
  <pre><code>- (void)drawRect:(CGRect)rect
  {
      [super drawRect:rect];
  
      CGSize size = self.bounds.size;
      CGContextRef context = UIGraphicsGetCurrentContext();
  
      CGRect faceRect = CGRectMake(0, 0, size.width, size.height);
      UIGraphicsBeginImageContextWithOptions(faceRect.size, NO, 0.0);
  
      [[self faceColorForState:self.state] set];
  
      [self drawRoundedRect:faceRect radius:self.radius context:UIGraphicsGetCurrentContext()];
      UIImage *faceImage = UIGraphicsGetImageFromCurrentImageContext();
  
      UIGraphicsEndImageContext();
  
      [[self sideColorForState:self.state] set];
  
      CGRect sideRect = CGRectMake(0, size.height * 1.0 / 4.0, size.width, size.height * 3.0 / 4.0);
      [self drawRoundedRect:sideRect radius:self.radius context:context];
  
      CGRect faceShrinkedRect;
      if(self.state == UIControlStateSelected || self.state == UIControlStateHighlighted) {
          faceShrinkedRect = CGRectMake(0, self.depth, size.width, size.height - self.margin);
      } else {
          faceShrinkedRect = CGRectMake(0, 0, size.width, size.height - self.margin);
      }
      [faceImage drawInRect:faceShrinkedRect];
  }
  </code></pre>