Just did this:
self.imageView.backgroundColor = color1;
self.imageView.layer.masksToBounds = YES;
self.imageView.layer.borderColor = color1;
self.imageView.layer.borderWidth = 3.0;
Here is screenshot of the problem:
I can see image, borders, and image fragments out of the border…
How can I fix it?
I had a similar issue using the border properties on the layer and managed to solve it by adding a CAShapeLayer on top.
I can't tell you how it will behave on older devices as haven't tested it with many animations and so on, but I really doubt it will slow them down.
Here is some code in Swift:
Hope it will work in your case as well
Try :