Toggle UISwitch as BarButtonItem
<p>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.</p>

<pre><code>@IBOutlet weak var toggleOutlet: UIBarButtonItem!
@IBAction func toggleButton(sender: UIBarButtonItem) {

   // if toggleOutlet.on // not recognized as bar button item
</code></pre>

<p>if anyone could help that would be great 
thanks</p>