Swift/UISwitch: comment mettre en œuvre un délégué/écouteur

Dans mon UITableViewController j'ai une cellule personnalisé qui contient un aiguilleur qui est la suivante:

import Foundation
import UIKit

class SwitchCell: UITableViewCell {
  @IBOutlet weak var label : UILabel!
  @IBOutlet weak var switchEmail : UISwitch!

  func setEditable(canEdit:Bool) {
      if (canEdit) {
        self.switchEmail.enabled = true
        self.label.highlighted = false
      }
      else {
          self.switchEmail.enabled = false
          self.label.highlighted = true
      }
  }

  func configureCellWithSwitch(labelText:String, switchValue:Bool, enabled:Bool) {

    var labelFrame:CGRect = self.label.frame
    labelFrame.size.height = Settings.labelHeight
    self.label.frame = labelFrame

    self.label.text = labelText

    if (switchValue) {
        self.switchEmail.setOn(true, animated: true)
    }
    else {
        self.switchEmail.setOn(false, animated: true)
    }

    self.setEditable(enabled)

  }
}

Je voudrais savoir comment mettre en œuvre un auditeur ou le délégué à la base afin d'obtenir la valeur de la UITableViewController. J'ai pu écrire délégué/écouteurs pour une cellule avec UITextField et UITextView mise en œuvre de méthodes

func controller(controller: UITableViewCell, textViewDidEndEditing: String, atIndex: Int)

et

func controller(controller: UITableViewCell, textFieldDidEndEditingWithText: String, atIndex: Int)

mais je ne sais pas ce que je doit mettre en œuvre le commutateur.

OriginalL'auteur SagittariusA | 2015-09-15