@IBOutlet weak var catParentIdButton: UIButton!
I have this code, and now I want to write a program label programmatically.What will be the syntax for writing a button label in swift 3.0?
Method signature changed in Swift 3.0
func setTitle(_ title: String?, for state: UIControlState) // Use this method to set the title for the button
Example:
btn.setTitle(title: "Title", for: .normal)
Note The default state for btn control is changed from .Normal to .Normal .
.Normal
// previous public static var Normal: UIControlState { get } // Swift 3.0 static var normal: UIControlState { get }