I am having difficulty implementing an action for an NSMenuItem in Swift. Normally, you implement the action like this in Objective-C:
- (void) asdf:(id)sender
This works perfectly fine, after setting up the action in the first responder like so:
However, after rewriting my view controller in Swift, the following new method doesn't seem to be called:
func asdf(sender: AnyObject?)
It doesn't seem to work, even though both the Obj-C and Swift versions are for the same view controller subclass.

In Swift 3.0 you'd define it as:
Why?
If you use
_you can drop parameter name when calling a function, so now you can call it like:Instead of:
Moreover, with Swift you'd use
Anyinstead ofAnyObjectin this context. You can find more on differences between those here.