Created
December 15, 2016 18:00
-
-
Save iamkingalvarado/98ca7ddebe695645ca56fb5f2fee1854 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| @IBDesignable final class EMPView: UIView { | |
| @IBInspectable var borderColor:UIColor = UIColor.clear | |
| @IBInspectable var borderWidth:CGFloat = 0.0 | |
| @IBInspectable var cornerRadius:CGFloat = 0.0 | |
| @IBInspectable var shadowColor:UIColor = UIColor.clear | |
| @IBInspectable var shadowOffset:CGSize = CGSize(width: 0, height: 0) | |
| @IBInspectable var shadowRadius:CGFloat = 0.0 | |
| @IBInspectable var shadowOpacity:CGFloat = 0.0 | |
| override func draw(_ rect: CGRect) { | |
| layer.borderColor = borderColor.cgColor | |
| layer.borderWidth = borderWidth | |
| layer.cornerRadius = cornerRadius | |
| layer.shadowColor = shadowColor.cgColor | |
| layer.shadowOffset = shadowOffset | |
| layer.shadowRadius = shadowRadius | |
| layer.shadowOpacity = Float(shadowOpacity) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment