title: Set Background Image to UILabel Properly in iOS
body: <p>So How you will set a background image to UILabel.</p>
  <p>Here is the ways i have tried after googling and reading some of Stackoverflow posts.</p>
  <p>I have a image and want to fit / shrink according to size of UILabel.</p>
  <p><strong>1 --</strong></p>
  <pre><code>lblDelivery.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@&quot;Tick.png&quot;]];
  </code></pre>
  <p>and result is :</p>
  <p><img src="https://i.stack.imgur.com/vp0w0.png" alt="enter image description here" /></p>
  <p><strong>2 --</strong></p>
  <pre><code>UIImage *img = [UIImage imageNamed:@&quot;Tick.png&quot;];
  CGSize imgSize = lblDelivery.frame.size;
  UIGraphicsBeginImageContext( imgSize );
  [img drawInRect:CGRectMake(0,0,imgSize.width,imgSize.height)];
  UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext();
  UIGraphicsEndImageContext();
  lblDelivery.backgroundColor = [UIColor colorWithPatternImage:newImage];
  </code></pre>
  <p>and result is :</p>
  <p><img src="https://i.stack.imgur.com/SzjH9.png" alt="enter image description here" /></p>
  <p>Please help on this issue. how to i can get this image in BG perfectly</p>