How can I add padding between an UIImageView
and its border?
Img.layer.cornerRadius = Img.bounds.width / 2
Img.layer.borderWidth = 2
Img.layer.
For adding padding to the UIImage of UIImageView, use the below piece of code in Swift
let padding: CGFloat = 6
myImageView.contentMode = .scaleAspectFill
myImageView.image = UIImage(named: "myImage.png").resizableImage(withCapInsets: UIEdgeInsets(top: padding, left: padding, bottom: padding, right: padding), resizingMode: .stretch)