in storyboard (xcode 6) i want a circular user image profile take from Facebook.
So i have make this interface in storyboard, using auto layout:
Then, using Facebook iOS sdk i take the user profile (using swift):
var facebookProfileUrl = "http://graph.facebook.com/\(userId!)/picture?type=normal";
In storyboard i have set the image to "Scale to fit" mode. To make the image view circular i use the following code:
self.facebookProfileImage.layer.cornerRadius = self.facebookProfileImage.frame.size.width / 2;
self.facebookProfileImage.clipsToBounds = true;
When i run the code, anyway the image doesn't look circular:
I suppose the problem is auto layout but i'm not sure. How can i make the image perfectly circular??