SwiftDeveloper SwiftDeveloper - 5 months ago 14
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

Yeah finally i found ios 10 control state working code.

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

i think will help many people