Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. //
  2. // UIView+Shadow.swift
  3. //
  4. // Created by Dan Merfeld on 1/14/17.
  5. // Copyright © 2017 TheoryThree. All rights reserved.
  6. //
  7.  
  8. import UIKit
  9.  
  10. extension UIView {
  11.  
  12. func shadow(opacity:Float, radius:CGFloat) {
  13.  
  14. self.layer.masksToBounds = false
  15. self.layer.shadowColor = UIColor.black.cgColor
  16. self.layer.shadowOpacity = opacity
  17. self.layer.shadowOffset = CGSize.zero
  18. self.layer.shadowRadius = radius
  19. self.layer.shadowPath = UIBezierPath(rect: self.bounds).cgPath
  20. }
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement