title: draw dotted border around UIlabel containing text
body: <p>Can anybody please explain which is the right way to draw a dotted rectangular border around <code>UILabel</code> which can be resized and movable, I have searched a lot, found 2 ways:</p>
  
  <p>First is,</p>
  
  <pre><code>_border = [CAShapeLayer layer];
  
  _border.strokeColor = [UIColor colorWithRed:67/255.0f green:37/255.0f blue:83/255.0f alpha:1].CGColor;
  
  _border.fillColor = nil;
  
  _border.lineDashPattern = @[@4, @2];
  
  [self.layer addSublayer:_border];
  </code></pre>
  
  <p>And in your layoutsubviews, put this:</p>
  
  <pre><code>_border.path = [UIBezierPath bezierPathWithRect:self.bounds].CGPath;
  _border.frame = self.bounds;
  </code></pre>
  
  <p>Second is,
   It could be done by drawing a border around <code>NSAttributed</code> String in <code>UILabel</code></p>
  
  <p>Issues:</p>
  
  <ol>
  <li>Since for resizing the <code>UILabel</code> based on user touch,already I am changing its size touch methods,again I need to write bunch of lines to resize the border layer</li>
  <li>Didn't get the approach to draw border on away from text not on text itself.</li>
  </ol>
  
  <p>Can anybody please help in sorting the optimized approach. </p>