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:
parent
94da6fc7de
commit
9a1ccc4296
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue