Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class OvalLayer: CAShapeLayer {
- let animationDuration: CFTimeInterval = 0.3
- override init() {
- super.init()
- fillColor = Colors.green.CGColor
- path = ovalPathSmall.CGPath
- }
- required init?(coder aDecoder: NSCoder) {
- fatalError("init(coder:) has not been implemented")
- }
- var ovalPathStart: UIBezierPath {
- let path = UIBezierPath(ovalInRect: CGRect(x: 0.0, y: 0.0, width: 100.0, height: 100.0))
- return path
- }
- }
- UIBezierPath(roundedRect: anyView.bounds, cornerRadius: CGSize(width: 10.0, height: 10.0))
- UIBezierPath(roundedRect: anyView.bounds,
- byRoundingCorners: .BottomLeft | .BottomRight,
- cornerRadius: CGSize(width: 10.0, height: 10.0))
- let pathWithRadius = UIBezierPath(roundedRect:yourView.bounds, byRoundingCorners:[.TopRight, .TopLeft], cornerRadii: CGSizeMake(5.0, 5.0))
- let maskLayer = CAShapeLayer()
- maskLayer.pathWithRadius = pathWithRadius.CGPath
- yourView.layer.mask = maskLayer
- [.TopRight,.TopLeft,.BottomRight, .BottomLeft]
- let path1 = UIBezierPath(roundedRect: CGRect, cornerRadius: CGFloat)
- let path1 = UIBezierPath(roundedRect: CGRect, byRoundingCorners: UIRectCorner, cornerRadii: CGSize))
- UIBezierPath* path = [UIBezierPath
- bezierPathWithRoundedRect: CGRectMake(0, 0, 150, 153)
- cornerRadius: 50];
- var path: UIBezierPath = UIBezierPath(roundedRect: CGRectMake(0, 0, 150, 153), cornerRadius: 50)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement