Reputation: 3537
I'm trying to set the keyboard shortcut modifier of a NSMenuItem.
myMenuItem.keyEquivalentModifierMask = .shift | .command
But I'm getting an error "Type of expression is ambiguous without more context".
I wasn't able to find how to use this bit operator correctly in Swift.
Upvotes: 0
Views: 194
Reputation: 93161
You are using the C-style bitwise or. In Swift it has been changed to an OptionSet
:
myMenuItem.keyEquivalentModifierMask = [.shift, .command]
Upvotes: 2