My code works for the most part.
I had a similar issue, my UIImageView
was initially a square and would only show as circular when the UITableViewCell
it was within was either highlighted or selected.
It was a simple fix:
Swift 2.0
imgView.layer.cornerRadius = imgView.frame.width / 2
imgView.clipsToBounds = true
This was placed inside the awakeFromNib()
for my custom UITableViewCell
.
This is assuming imgView
is the name of the UIImageView
hooked up via storyboard inside this custom UITableViewCell
.