EXC_BAD_ACCESS Using IBInspectable
问题 I am trying to use IBInspectable to add borders to my views. extension UIView { private func getBorder(integer: Int) -> UIRectEdge { if integer == 1 { return .top } else if integer == 2 { return .left } else if integer == 3 { return .right } else if integer == 4 { return .bottom } return .all } @IBInspectable var border: Int? { get { return self.border } set (value) { self.border = value for v in addBorder(edges: self.getBorder(integer: self.border!)) { self.addSubview(v) } } } @IBInspectable