创建圆角 抛出一个错误:二元运算符“|”不能用于两个UIRectCorner操作数

//        let beizer:UIBezierPath = UIBezierPath(roundedRect: btn5.bounds, byRoundingCorners: UIRectCorner.TopLeft|UIRectCorner.TopRight, cornerRadii: CGSize( 15, height: 15))

使用下面代码代替即可

        let beizer:UIBezierPath = UIBezierPath(roundedRect: btn5.bounds, byRoundingCorners: [UIRectCorner.TopLeft,UIRectCorner.TopRight], cornerRadii: CGSize( 15, height: 15))

原文地址:https://www.cnblogs.com/tian-sun/p/5026380.html