I switched my project over to new beta versions of iOS 10 and XCode 8. In all three areas of my app where I use:
imageView.layer.cornerRadius = imageView.fra
I had ImageView that is fully circular in shape. Below is code :
//MARK:- Misc functions
func setProfileImage() {
imgProfile.layer.masksToBounds = false
imgProfile.layer.cornerRadius = imgProfile.frame.size.height/2
imgProfile.clipsToBounds = true
imgProfile.contentMode = UIViewContentMode.ScaleToFill
}
This works fine in iOS 9. However, in iOS 10 Xcode 8 the ImageView disappears.
After debugging found that ClipsToBound is culprit.
So placed the code in viewDidLayoutSubviews()
resolved the issue.
override func viewDidLayoutSubviews() {
setProfileImage()
}
You can also use self.view.layoutIfNeeded()