In my UITableViewController I have a custom cell which contains a switcher which is the following:
import Foundation import UIKit class SwitchCell: UITableV
In Swift 5
switchDemo.addTarget(self, action: #selector(didTapAdvertise), for:UIControl.Event.valueChanged) @objc func didTapAdvertise(mySwitch: UISwitch) { let value = mySwitch.isOn // Do something print("switch value changed \(value)") }