Skip to content

Instantly share code, notes, and snippets.

@NarendraPunchh
Created November 24, 2016 07:06
Show Gist options
  • Save NarendraPunchh/28a08040a7ec87e82d75b789cfc7eff9 to your computer and use it in GitHub Desktop.
Save NarendraPunchh/28a08040a7ec87e82d75b789cfc7eff9 to your computer and use it in GitHub Desktop.
- (void)setMaskImage {
CALayer *mask = [CALayer layer];
mask.contents = (id)[[UIImage imageNamed:@"infoLogo"] CGImage];
mask.frame = self.imgItem.bounds;
self.imgItem.layer.mask = mask;
self.imgItem.layer.masksToBounds = YES;
self.imgItem.contentMode = UIViewContentModeCenter;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment