Skip to content

Instantly share code, notes, and snippets.

@Tintenklecks
Forked from jeffbailey/CircleUIImageViewMask
Created January 25, 2014 12:30
Show Gist options
  • Save Tintenklecks/8615650 to your computer and use it in GitHub Desktop.
Save Tintenklecks/8615650 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