I have a switch as a bar button but I am not sure how to reference the on/off value for a bar button item. XCode does not allow for the switch to be recognized as anything else except a bar button item. The switch is embedded in the barbutton and unable to be referenced.
@IBOutlet weak var toggleOutlet: UIBarButtonItem!
@IBAction func toggleButton(sender: UIBarButtonItem) {
// if toggleOutlet.on // not recognized as bar button item
if anyone could help that would be great thanks