0

How can I make the borders to be a little bit more away from the image and not be directly attached to it like you can see at the screenshot enter image description here

  • 7
    Possible duplicate of [How do I make an UIImage/-View with rounded corners CGRect (Swift)](https://stackoverflow.com/questions/25476139/how-do-i-make-an-uiimage-view-with-rounded-corners-cgrect-swift) – Robert Dresler Apr 02 '19 at 16:27

3 Answers3

1

In order to have rounded corners you have to set

imageView.layer.cornerRadius = 9 //Or any other number

In order to make the borders further from the borders just change your constraints' values.

0

Try this

imageView.layer.cornerRadius = 10
imageView.layer.masksToBounds = true
Santosh
  • 363
  • 2
  • 14
0

I don't know if I understand the question correctly but you might be looking for something like:

imageView.contentMode = .scaleAspectFit
Axort
  • 2,034
  • 2
  • 23
  • 24