Skip to content

Instantly share code, notes, and snippets.

@inailuy
Last active December 13, 2015 23:09
Show Gist options
  • Save inailuy/4990006 to your computer and use it in GitHub Desktop.
Save inailuy/4990006 to your computer and use it in GitHub Desktop.
making a shadow for a view in iOS
//Adds a shadow to sampleView
CALayer *layer = self.sampleView.layer;
layer.shadowOffset = CGSizeMake(1, 1);
layer.shadowColor = [[UIColor blackColor] CGColor];
layer.shadowRadius = 4.0f;
layer.shadowOpacity = 0.80f;
layer.shadowPath = [[UIBezierPath bezierPathWithRect:layer.bounds] CGPath];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment