-1

I want to try to change a button title in swift 3 and iOS 10, but it doesn't change. My codes clear, is this a bug ?

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

print("tel = \(tel)")

Nothing shows ! And button title doesn't change !

Is this a bug ? Codes looking clear

miaout17
  • 4,715
  • 2
  • 26
  • 32
SwiftDeveloper
  • 7,244
  • 14
  • 56
  • 85

1 Answers1

3

Yeah, I finally found iOS 10 control state working code.

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

I think this will help many people.

mhatch
  • 4,441
  • 6
  • 36
  • 62
SwiftDeveloper
  • 7,244
  • 14
  • 56
  • 85