title: How to en-/disable Menu-Object programmatically in Swift
body: <p>I would like to en-/disable a <code>Menu-Object</code> programmatically in Swift. I found something one the <code>Apple Developer Library</code>: <a href="https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSMenuItem_Class/#//apple_ref/occ/instp/NSMenuItem/enabled" rel="nofollow">https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSMenuItem_Class/#//apple_ref/occ/instp/NSMenuItem/enabled</a></p>
  
  <p>But how to get a reference to the <code>Menu-Object</code> with the code and set its state programmatically?</p>