Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. class OvalLayer: CAShapeLayer {
  2.  
  3. let animationDuration: CFTimeInterval = 0.3
  4.  
  5. override init() {
  6. super.init()
  7. fillColor = Colors.green.CGColor
  8. path = ovalPathSmall.CGPath
  9. }
  10.  
  11. required init?(coder aDecoder: NSCoder) {
  12. fatalError("init(coder:) has not been implemented")
  13. }
  14. var ovalPathStart: UIBezierPath {
  15. let path = UIBezierPath(ovalInRect: CGRect(x: 0.0, y: 0.0, width: 100.0, height: 100.0))
  16.  
  17. return path
  18. }
  19. }
  20.  
  21. UIBezierPath(roundedRect: anyView.bounds, cornerRadius: CGSize(width: 10.0, height: 10.0))
  22.  
  23. UIBezierPath(roundedRect: anyView.bounds,
  24. byRoundingCorners: .BottomLeft | .BottomRight,
  25. cornerRadius: CGSize(width: 10.0, height: 10.0))
  26.  
  27. let pathWithRadius = UIBezierPath(roundedRect:yourView.bounds, byRoundingCorners:[.TopRight, .TopLeft], cornerRadii: CGSizeMake(5.0, 5.0))
  28. let maskLayer = CAShapeLayer()
  29. maskLayer.pathWithRadius = pathWithRadius.CGPath
  30. yourView.layer.mask = maskLayer
  31.  
  32. [.TopRight,.TopLeft,.BottomRight, .BottomLeft]
  33.  
  34. let path1 = UIBezierPath(roundedRect: CGRect, cornerRadius: CGFloat)
  35.  
  36. let path1 = UIBezierPath(roundedRect: CGRect, byRoundingCorners: UIRectCorner, cornerRadii: CGSize))
  37.  
  38. UIBezierPath* path = [UIBezierPath
  39. bezierPathWithRoundedRect: CGRectMake(0, 0, 150, 153)
  40. cornerRadius: 50];
  41.  
  42. var path: UIBezierPath = UIBezierPath(roundedRect: CGRectMake(0, 0, 150, 153), cornerRadius: 50)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement