UIView圆angular – Swift 2.0?

我试图更新一些项目到Swift 2.0。 我有一个视图,左上angular有一个圆angular。 一切正常,在Swift <1.2,但现在,没有圆angular了。

没有警告,没有错误,只是没有圆angular。

这是如何工作在Swift <1.2。

let maskPath = UIBezierPath(roundedRect: contentView.bounds,byRoundingCorners: .TopLeft, cornerRadii: CGSize(width: 10.0, height: 10.0)) let maskLayer = CAShapeLayer(layer: maskPath) maskLayer.frame = contentView.bounds maskLayer.path = maskPath.CGPath contentView.layer.mask = maskLayer 

任何人都知道这里错了什么? 我不会在文档中find任何更改。

Swift 2.0-2.1中的这段代码没有任何问题。 你确定这个代码片段之前或之后没有别的东西,这影响你的观点?

这里有一个你的代码快速游乐场:

在这里输入图像说明