Move array of sendToCommands from AppDelegate to SharingServicePickerDelegate, where it belongs, since it’s the only place where it’s used.

This commit is contained in:
Brent Simmons 2018-12-27 21:49:18 -08:00
parent 94da6fc7de
commit 9a1ccc4296
2 changed files with 5 additions and 5 deletions

View File

@ -31,10 +31,6 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations,
@IBOutlet var sortByNewestArticleOnTopMenuItem: NSMenuItem!
@IBOutlet var checkForUpdatesMenuItem: NSMenuItem!
lazy var sendToCommands: [SendToCommand] = {
return [SendToMicroBlogCommand(), SendToMarsEditCommand()]
}()
var unreadCount = 0 {
didSet {
if unreadCount != oldValue {

View File

@ -26,9 +26,13 @@ import AppKit
return sharingServiceDelegate
}
private static let sendToCommands: [SendToCommand] = {
return [SendToMicroBlogCommand(), SendToMarsEditCommand()]
}()
static func customSharingServices(for items: [Any]) -> [NSSharingService] {
let customServices = appDelegate.sendToCommands.compactMap { (sendToCommand) -> NSSharingService? in
let customServices = sendToCommands.compactMap { (sendToCommand) -> NSSharingService? in
guard let object = items.first else {
return nil