title: iOS, Swift -How disable a UIButton?
body: <p>I'm currently working on an App that uses Parse as backend system. I would like to implement a "Liking" feature. Here's my code</p>
  
  <pre><code> @IBAction func ButtonPressed(sender: AnyObject) {
  
      var query = PFQuery(className: "Content")
  
      query.getObjectInBackgroundWithId(object.objectId, block: { (obj:PFObject!, error:NSError!) -&gt; Void in
  
  
          if error != nil{
              println("Update error \(error.localizedDescription)")
          }else{
  
              var likesNumber = obj.objectForKey("Likes")[0] as Int
              obj["Likes"] = [likesNumber + 1]
  
              self.likeslab.setTitle("\(likesNumber + 1) likes", forState: UIControlState.Normal)
              self.likesButton.enabled = false
  
              obj.save()
  
  
              }
  
  
      })
  
  
  }
  </code></pre>
  
  <p>The code works well unfortunately, I've a problem: after a user touch on the button I would like to disable it (in order to avoid multiples likes from a same user). I try do that on the following line:</p>
  
  <pre><code> self.likesButton.enabled = false
  </code></pre>
  
  <p>And It's working but if the user leave the view and then go back, the button is enabled again.
  Thank you very much for your help !</p>