标签: swift
我想在Swift中继承UIButton。设置buttonType
buttonType
class MyButton: UIButton { init(label: KeyLabelType) { super.init(frame: CGRectZero) self.buttonType = UIButtonType.Custom } }
有关为什么这不正确的任何建议?
答案 0 :(得分:4)
苹果文档说buttonType是一个只读属性。您必须找到解决方法。 This answer可能会为您提供所需内容。