I have an older version of Swift and trying to do this:
let button = UIButton.buttonWithType(UIButtonType.detailDisclosure) as UIButton
But get the error
buttonWithType' is unavailable: use object construction 'UIButton(type:)
How can I solve this? I'm using Swift 3.
For Swift 3 the syntax is the following: