title: adding white border along a circle UIImage
body: <p>I have generated a circle UIImage using a mask as following (where masked_circle is a black circle):</p>
  
  <pre><code>CGContextRef context = UIGraphicsGetCurrentContext();
      CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
  
      UIImage *maskImage = [UIImage imageNamed:@"masked_circle.png"];
      CGImageRef maskImageRef = [maskImage CGImage];
  
      // create a bitmap graphics context the size of the image
      CGContextRef mainViewContentContext = CGBitmapContextCreate (NULL, maskImage.size.width, maskImage.size.height, 8, 0, colorSpace, kCGImageAlphaPremultipliedLast);
  
      CGFloat ratio = 0;
      ratio = maskImage.size.width/ self.image_.size.width;
  
      if(ratio * self.image_.size.height &lt; maskImage.size.height) {
          ratio = maskImage.size.height/ self.image_.size.height;
      }
  
      CGRect rect1  = {{0, 0}, {maskImage.size.width, maskImage.size.height}};
      CGRect rect2  = {{-((self.image_.size.width*ratio)-maskImage.size.width)/2 , -((self.image_.size.height*ratio)-maskImage.size.height)/2}, {self.image_.size.width*ratio, self.image_.size.height*ratio}};
  
      CGContextClipToMask(mainViewContentContext, rect1, maskImageRef);
      CGContextDrawImage(mainViewContentContext, rect2, self.image_.CGImage);
  
      CGImageRef newImage = CGBitmapContextCreateImage(mainViewContentContext);
      CGContextRelease(mainViewContentContext);
  
      UIImage *theImage = [UIImage imageWithCGImage:newImage];
  </code></pre>
  
  <p>Now after this I wanted to add a 1px white border around the circle image, how can I do so?</p>