dynamic var borderColor: UIColor? = .black { didSet { layer.borderWidth = 1.0 layer.borderColor = borderColor?.cgColor } } BorderView.appearance().borderColor = .red