📅  最后修改于: 2022-03-11 15:00:59.760000             🧑  作者: Mango
// There is no way to do this. But there is a little workaround.
// Swift 5:
public enum Size: String {
case small = "small"
case medium = "medium"
case large = "large"
}
class SizeView: UIView {
private var size: Size = .large
@IBInspectable
public var sizeName: String = "large" {
didSet {
guard self.sizeName != oldValue else { return }
self.size = Size(rawValue: self.sizeName)
}
}
}