Skip to content
Kevin Leong edited this page Nov 8, 2016 · 1 revision

UIImageView

Circular Images

class MyCell: UITableViewCell {
    @IBOutlet weak var myImage: UIImageView!

    override func awakeFromNib() {
        super.awakeFromNib()

        // Circular avatar image
        myImage.layer.cornerRadius = myImage.frame.width / 2
        myImage.clipsToBounds = true

        // Image border
        myImage.layer.borderWidth = 3.0
        myImage.layer.borderColor = UIColor.darkGray.cgColor
    }
}

References

Clone this wiki locally