Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extension UIView {
- func dropShadow(color: UIColor, opacity: Float = 0.3, offSet: CGSize, radius: CGFloat = 10, scale: Bool = true) {
- layer.masksToBounds = false
- layer.shadowColor = color.cgColor
- layer.shadowOpacity = opacity
- layer.shadowOffset = offSet
- layer.shadowRadius = radius
- layer.shadowPath = UIBezierPath(rect: self.bounds).cgPath
- layer.shouldRasterize = true
- layer.rasterizationScale = scale ? UIScreen.main.scale : 1
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement