Skip to content

Instantly share code, notes, and snippets.

@bitwit
Created March 11, 2014 20:55
Show Gist options
  • Save bitwit/9494879 to your computer and use it in GitHub Desktop.
Save bitwit/9494879 to your computer and use it in GitHub Desktop.
- (void)setupShadowForView:(UIView *)view {
UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:view.frame cornerRadius:10];
CALayer *viewLayer = view.layer;
[viewLayer setShadowColor:[UIColor blackColor].CGColor];
[viewLayer setShadowOpacity:1.0f];
[viewLayer setShadowRadius:10.0f];
[viewLayer setShadowPath:[path CGPath]];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment