此前的UIButton情况下,你能够传递UIControlState.Normal的setTitle或setImage. .Normal不再可用,我应该使用什么?
let btn = UIButton(frame: CGRect(x: 0, y: 0, width: 20, height: 20))
btn.setTitle("title", for: .Normal) // does not compile
Run Code Online (Sandbox Code Playgroud)
(这是一个规范的问答对,以防止与此相关的重复问题UIButton以及UIControliOS 10和Swift 3的变化)