0

How to programmatically change the borderWidth of a Image view which is on a UIView and present inside a prototypeCell

I have tried changing the borderWidth in interface Builder, but it is not working.1

looking forward for a better solution.2

1 Answers1

0

you can try something like this

   @IBOutlet weak var imageView: UIImageView!
        // makes it circle if Width == Height
        imageView.layer.cornerRadius = imageView.frame.width / 2
        //Bordering
        imageView.layer.borderColor = UIColor.black.cgColor
        imageView.layer.borderWidth = 1
Mohmmad S
  • 5,001
  • 4
  • 18
  • 50