I have an application , where I drag a circular UIImageView on top of another UIImageView , and since a circle could never be squared , the white borders of the image must show , so I wonder if there is a way to remove those borders or to hide them (not by making them have the same color ).
2 Answers
I am expecting that you are looking for image masking feature. Have a look at this tutorial and this one too. Both of them uses CoreGraphics frame functions and are really quicker in response.
Please note that it is not the Swift version but will give you atleast a starter.
-
Your answer did work for me , but i think it's kind of long to mask an image , actually I have found that corner radius have did the same thing but with less code, but nevertheless I have finally understood what masking means Aug 20, 2014 at 23:07
try to set the image.layer.borderWidth = 0
(this is the swift version)
-
I have tried your code , I think you forgot to put the layer property though , and the border width didn't help me Aug 20, 2014 at 23:04
-
Well that was actually no real code you should take, just a suggestion. But sorry that did not work Aug 20, 2014 at 23:18
-