title: UIBezierPath: How to add a border around a view with rounded corners?
body: <p>I am using UIBezierPath to have my imageview have round corners but I also want to add a border to the imageview. Keep in mind the top is a uiimage and the bottom is a label.</p>
  
  <p>Currently using this code produces:</p>
  
  <pre><code>let rectShape = CAShapeLayer()
  rectShape.bounds = myCell2.NewFeedImageView.frame
  rectShape.position = myCell2.NewFeedImageView.center
  rectShape.path = UIBezierPath(roundedRect: myCell2.NewFeedImageView.bounds,
      byRoundingCorners: .TopRight | .TopLeft,
      cornerRadii: CGSize(width: 25, height: 25)).CGPath
  myCell2.NewFeedImageView.layer.mask = rectShape
  </code></pre>
  
  <p><img src="https://i.imgur.com/Dj1c2Qb.png" alt="current"></p>
  
  <p>I want to add a green border to that but I cant use</p>
  
  <pre><code>myCell2.NewFeedImageView.layer.borderWidth = 8
  myCell2.NewFeedImageView.layer.borderColor = UIColor.greenColor().CGColor
  </code></pre>
  
  <p>because it cuts off the top left and top right corner of the border as seen in this image:</p>
  
  <p><img src="https://i.imgur.com/lZSz6Yt.png" alt="issue"></p>
  
  <p>Is there a way too add in a border with UIBezierPath along with my current code?</p>