mardi 5 mai 2015

how to hide/show a button in swift

I'm trying to have a if statement that will make a button be hidden when a label displays a certain status and appear when the label says something else. The name of label is Status and when is shows "Closed" I want it hidden and when it shows "Open" it will appear.

    var query3 = PFQuery(className:"Status_of_game")
    query3.findObjectsInBackgroundWithBlock{

    (namelist3: [AnyObject]!, error : NSError!) -> Void in

    for list3 in namelist3 {

    var output = list3["StatusType"] as String

    self.Status.text = output

     println(output)

     if self.Status.text == "Closed" {

     Purchase().enable = false
            }

        }

    }

}

Aucun commentaire:

Enregistrer un commentaire