In my UITableViewController I have a custom cell which contains a switcher which is the following:
import Foundation import UIKit class SwitchCell: UITableV
Swift 3:
@IBOutlet weak var mySwitch: UISwitch! mySwitch.addTarget(self, action: #selector(MyClass.switchChanged(_:)), for: UIControlEvents.valueChanged) func switchChanged(_ mySwitch: UISwitch) { if mySwitch.isOn { // handle on } else { // handle off } }