Created
March 4, 2016 19:45
-
-
Save maxcampolo/f8c8e068555c4ad65572 to your computer and use it in GitHub Desktop.
Add a drop shadow to a UIView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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