I have been trying to create a circular image but for some reason it has been outputting as a diamond. This is my code:
override func viewDidLoad() {
displayEmailFullNameImage()
self.editProfilePictureImage.layer.cornerRadius = editProfilePictureImage.frame.size.width / 2
self.editProfilePictureImage.clipsToBounds = true
self.editProfilePictureImage.contentMode = .scaleAspectFill
}
My Constraints on the photo:
I have tried the following solution:
override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews()
profilePic.layer.cornerRadius = profilePic.frame.width / 2
profilePic.clipsToBounds = true
}
BUT this does not work either.
This is how the image looks:
Any help would be appreciated.