Created
February 12, 2018 15:37
-
-
Save leoiphonedev/b175544c3b39865ed54edce789fe5424 to your computer and use it in GitHub Desktop.
How to add shadow to all sides of UIView in swift 4
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
self.cntView.layer.cornerRadius = 13.0 | |
self.cntView.layer.shadowColor = UIColor.lightGray.cgColor | |
self.cntView.layer.shadowOpacity = 0.5 | |
self.cntView.layer.shadowRadius = 10.0 | |
self.cntView.layer.shadowOffset = .zero | |
self.cntView.layer.shadowPath = UIBezierPath(rect: self.cntView.bounds).cgPath | |
self.cntView.layer.shouldRasterize = true | |
//Note:- cntView is an IBOutlet | |
//@IBOutlet weak var cntView: UIView! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment