Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func addShadow(to view: UIView) {
- view.layer.shadowColor = shadowColor
- view.layer.shadowOpacity = shadowOpacity
- view.layer.shadowOffset = shadowOffset
- if let bounds = view.subviews.first?.bounds {
- view.layer.shadowPath = UIBezierPath(rect: bounds).cgPath
- }
- view.layer.shouldRasterize = true
- }
- for subview in self.view.subviews {
- if subview.isKind(of: UIButton.self) && subview.tag == 1 {
- addShadow(to: subview)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement