title: How to call selector from switch only when change to state ON in Swift?
body: <p>I need call a function with selector when change switch, but only when I set switch to On state:</p>
  
  <pre><code> cell.switchMy.addTarget(self, action: "openView", forControlEvents: UIControlEvents.ValueChanged)
  
    func openView(){
      var cell:CustomCell = self.tableView.dequeueReusableCellWithIdentifier("cell5") as CustomCell
      if(cell.switchMy.on == true){
          println("ON")
          self.performSegueWithIdentifier("segueUnl", sender: self)
      }
  }
  </code></pre>
  
  <p>If I use this code, always call the function, but I 'm controlling if the switch state is ON... How can this correctly?</p>