2016-10-17 69 views

回答

13

方法簽名在夫特3.0改變

func setTitle(_ title: String?, 
     for state: UIControlState) // Use this method to set the title for the button 

例如:

btn.setTitle(title: "Title", for: .normal) 

注意默認一BTN控制的狀態被改變爲.Normal.normal

// previous 
public static var Normal: UIControlState { get } 

// Swift 3.0 
static var normal: UIControlState { get } 
相關問題