title: UIImageView's layer border visible inset
body: <p>Just did this:</p>
  
  <pre><code>self.imageView.backgroundColor = color1;
  self.imageView.layer.masksToBounds = YES;
  self.imageView.layer.borderColor = color1;
  self.imageView.layer.borderWidth = 3.0;
  </code></pre>
  
  <p>Here is screenshot of the problem:</p>
  
  <p><img src="https://i.stack.imgur.com/tCkju.png" alt="Screenshot of a problem"></p>
  
  <p>I can see image, borders, and image fragments out of the border…</p>
  
  <p><img src="https://i.stack.imgur.com/iG3hq.png" alt="enter image description here">
  <img src="https://i.stack.imgur.com/MXywd.png" alt="enter image description here"></p>
  
  <p>How can I fix it?</p>