Use the menu.takeItems method.

This commit is contained in:
Brent Simmons 2018-02-09 22:10:52 -08:00
parent c77866c4d7
commit 46cae22987
1 changed files with 2 additions and 5 deletions

View File

@ -7,6 +7,7 @@
// //
import AppKit import AppKit
import RSCore
@objc final class SidebarContextualMenuDelegate: NSObject, NSMenuDelegate { @objc final class SidebarContextualMenuDelegate: NSObject, NSMenuDelegate {
@ -24,11 +25,7 @@ import AppKit
return return
} }
let items = contextualMenu.items menu.takeItems(from: contextualMenu)
contextualMenu.removeAllItems()
for menuItem in items {
menu.addItem(menuItem)
}
} }
} }