buttonWithType’不可用:使用对象构造’UIButton(类型:)
我有一个较旧版本的Swift并试图这样做:
let button = UIButton.buttonWithType(UIButtonType.detailDisclosure) as UIButton
但得到错误
buttonWithType’不可用:使用对象构造’UIButton(类型:)
我怎么解决这个问题? 我正在使用Swift 3。
对于Swift 3,语法如下:
let button = UIButton(type: .detailDisclosure)