I want to round my right corners, but only works for Left corners
let path = UIBezierPath(roundedRect: view.bounds, byRoundingCorners: [UIRectCorner.TopLeft, UIRectCorner.TopRight], cornerRadii: CGSizeMake(20.0, 20.0))
let maskLayer = CAShapeLayer()
maskLayer.path = path.CGPath
view.layer.mask = maskLayer
view.layer.masksToBounds = true
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…