With my project I use the following code in order to make my images in rounded shape:
profileImage.layer.cornerRadius = profileImage.frame.size.width / 2
pro
I had the same problem, the solution was just to move a line of code before your layer modifications. Try to apply layout changes:
self.view.layoutIfNeeded()
before your code:
profileImage.layer.cornerRadius = profileImage.frame.size.width/2
profileImage.clipsToBounds = true
OR
place your code related to frames / layers into viewDidLayoutSubviews()
method:
override func viewDidLayoutSubviews() {
profileImage.layer.cornerRadius = profileImage.frame.size.width/2
profileImage.clipsToBounds = true
}