Metin Atalay Metin Atalay - 1 year ago 73
Swift Question

Swift Some method Button text not change

I have one button in uiview

and i change button name and i get button name , it Getting old reputation . however When I call it from somewhere when the method is finished its true


enter image description here

Answer Source

Wrapping your if statements in a performWithoutAnimation block will prevent any delays in updates to the titleLabel.

UIView.performWithoutAnimation {
    if btnOne.titleLabel?.text == "qq" {
        btnOne.setTitle("metin", forState: .Normal)
        var a = btnOne.titleLabel?.text // "metin"
        mergeString += sender.titleLabel!.text!
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download