Skip to content

Instantly share code, notes, and snippets.

@maxcampolo
Created March 4, 2016 19:45
Show Gist options
  • Save maxcampolo/f8c8e068555c4ad65572 to your computer and use it in GitHub Desktop.
Save maxcampolo/f8c8e068555c4ad65572 to your computer and use it in GitHub Desktop.
Add a drop shadow to a UIView
let shadowPath = UIBezierPath(rect: self.myView.layer.bounds)
self.myView.layer.masksToBounds = false
self.myView.layer.shadowColor = UIColor.blackColor().CGColor
self.myView.layer.shadowOffset = CGSizeMake(0.0, -2.0)
self.myView.layer.shadowOpacity = 0.3
self.myView.layer.shadowRadius = 1.0
self.myView.layer.shadowPath = shadowPath.CGPath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment