Advertisement
Guest User

Untitled

a guest
Jan 30th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. func addShadow(to view: UIView) {
  2. view.layer.shadowColor = shadowColor
  3. view.layer.shadowOpacity = shadowOpacity
  4. view.layer.shadowOffset = shadowOffset
  5. if let bounds = view.subviews.first?.bounds {
  6. view.layer.shadowPath = UIBezierPath(rect: bounds).cgPath
  7. }
  8.  
  9. view.layer.shouldRasterize = true
  10. }
  11.  
  12. for subview in self.view.subviews {
  13. if subview.isKind(of: UIButton.self) && subview.tag == 1 {
  14. addShadow(to: subview)
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement