Skip to content

Instantly share code, notes, and snippets.

@jeffbailey
Created January 25, 2014 12:25
Show Gist options
  • Save jeffbailey/8615561 to your computer and use it in GitHub Desktop.
Save jeffbailey/8615561 to your computer and use it in GitHub Desktop.
Mask an UIImageView to a circle.
- (void)viewDidLayoutSubviews
{
[super viewDidLayoutSubviews];
self.imageView.layer.masksToBounds = YES;
self.imageView.layer.cornerRadius = self.imageView.bounds.size.width / 2.;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment