0

I am working on a profile pic.

I have added an UIImageView (say userImageView) on the storyboard with aspect mode SCALE TO FILL & added below code in my swift file

self.userImageView.layer.borderWidth = 10
self.userImageView.layer.borderColor = UIColor.white.cgColor
self.userImageView.layer.cornerRadius = self.userImageView.frame.height/2
self.userImageView.clipsToBounds = true

but when tried to add an image from camera or album, image is getting compressed.

I have also tried to resize the image but still, the image is getting compress.

What am I doing wrong?

pacification
  • 5,490
  • 3
  • 26
  • 49
Gagan_iOS
  • 3,326
  • 2
  • 28
  • 44

1 Answers1

5

In story board content mode is aspect fill or fit and click the clips to bounds its help to fit the image in the image view bounds

Nandhini
  • 374
  • 4
  • 7
  • 1
    FYI: "and click the clips to bounds" is the same as `self.userImageView.clipsToBounds = true` ;) – Ahmad F Sep 10 '18 at 14:06