在为roundImage创建UIimageview函数的类时出现以下错误,但是之前运行良好,但今天却出现此错误。谁能让我知道代码有什么问题。
import Foundation
@IBDesignable
class RoundImage: UIImageView{
@IBInspectable var cornerRadius: CGFloat = 0.0 {
didSet {
self.layer.cornerRadius = cornerRadius
}
}
// set border width
override var borderWidth: CGFloat = 0.0 {
didSet{
self.layer.borderWidth = borderWidth
}
}
// set border color
override var borderColor: UIColor = UIColor.clear {
didSet{
self.layer.borderColor = borderColor.cgColor
}
}
override func awakeFromNib() {
self.clipsToBounds = true
}
}