SwiftDeveloper SwiftDeveloper - 1 year ago 66
iOS Question

titleLabel?.text dont change ios 10 UIControlState

Hello I want to try button title change in swift 3, ios 10 but dont change my codes clear this is bug ?

@IBOutlet weak var tel: UIButton!
tel.titleLabel?.text = "+1 123 23 34"

print("tel = \(tel)")



Nothing shows ! And button title dont change !


This is bug ? Codes looking clear

Answer Source

Yeah finally i found ios 10 control state working code.

tel.setTitle("Button Title",  for: [])

i think will help many people