From 1aac355418591304f5b46ce67bf0001cc89e45a8 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sun, 11 Feb 2018 18:58:50 -0800 Subject: [PATCH] =?UTF-8?q?Make=20all=20senders=20parameters=20for=20actio?= =?UTF-8?q?ns=20optional=20=E2=80=94=C2=A0Any=3F=20instead=20of=20AnyObjec?= =?UTF-8?q?t=20or=20Any.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Evergreen-iOS/MasterViewController.swift | 2 +- Evergreen/AppDelegate.swift | 28 +++++++++---------- .../AddFeed/AddFeedWindowController.swift | 6 ++-- .../AddFolder/AddFolderWindowController.swift | 4 +-- .../MainWindow/MainWindowController.swift | 4 +-- .../Renaming/RenameWindowController.swift | 4 +-- .../Sidebar/SidebarViewController.swift | 4 +++ .../Timeline/TimelineViewController.swift | 4 +-- .../PreferencesWindowController.swift | 2 +- 9 files changed, 31 insertions(+), 27 deletions(-) diff --git a/Evergreen-iOS/MasterViewController.swift b/Evergreen-iOS/MasterViewController.swift index 8c49a2c90..eccbba797 100644 --- a/Evergreen-iOS/MasterViewController.swift +++ b/Evergreen-iOS/MasterViewController.swift @@ -38,7 +38,7 @@ class MasterViewController: UITableViewController { } @objc - func insertNewObject(_ sender: Any) { + func insertNewObject(_ sender: Any?) { objects.insert(NSDate(), at: 0) let indexPath = IndexPath(row: 0, section: 0) tableView.insertRows(at: [indexPath], with: .automatic) diff --git a/Evergreen/AppDelegate.swift b/Evergreen/AppDelegate.swift index d103ce06c..8609606f0 100644 --- a/Evergreen/AppDelegate.swift +++ b/Evergreen/AppDelegate.swift @@ -273,7 +273,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations, readerWindow.showWindow(self) } - @IBAction func showPreferences(_ sender: AnyObject) { + @IBAction func showPreferences(_ sender: Any?) { if preferencesWindowController == nil { preferencesWindowController = windowControllerWithName("Preferences") @@ -282,28 +282,28 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations, preferencesWindowController!.showWindow(self) } - @IBAction func showMainWindow(_ sender: AnyObject) { + @IBAction func showMainWindow(_ sender: Any?) { createAndShowMainWindow() } - @IBAction func refreshAll(_ sender: AnyObject) { + @IBAction func refreshAll(_ sender: Any?) { AccountManager.shared.refreshAll() } - @IBAction func showAddFeedWindow(_ sender: AnyObject) { + @IBAction func showAddFeedWindow(_ sender: Any?) { addFeed(nil) } - @IBAction func showAddFolderWindow(_ sender: AnyObject) { + @IBAction func showAddFolderWindow(_ sender: Any?) { createAndShowMainWindow() showAddFolderSheetOnWindow(mainWindowController!.window!) } - @IBAction func showFeedList(_ sender: AnyObject) { + @IBAction func showFeedList(_ sender: Any?) { if feedListWindowController == nil { feedListWindowController = windowControllerWithName("FeedList") @@ -353,7 +353,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations, logWindowController!.showWindow(self) } - @IBAction func importOPMLFromFile(_ sender: AnyObject) { + @IBAction func importOPMLFromFile(_ sender: Any?) { let panel = NSOpenPanel() panel.canDownloadUbiquitousContents = true @@ -378,11 +378,11 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations, } } - @IBAction func importOPMLFromURL(_ sender: AnyObject) { + @IBAction func importOPMLFromURL(_ sender: Any?) { } - @IBAction func exportOPML(_ sender: AnyObject) { + @IBAction func exportOPML(_ sender: Any?) { let panel = NSSavePanel() panel.allowedFileTypes = ["opml"] @@ -409,7 +409,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations, } } - @IBAction func addAppNews(_ sender: AnyObject) { + @IBAction func addAppNews(_ sender: Any?) { if AccountManager.shared.anyAccountHasFeedWithURL(appNewsURLString) { return @@ -417,17 +417,17 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations, addFeed(appNewsURLString, "Evergreen News") } - @IBAction func openWebsite(_ sender: AnyObject) { + @IBAction func openWebsite(_ sender: Any?) { Browser.open("https://ranchero.com/evergreen/", inBackground: false) } - @IBAction func openRepository(_ sender: AnyObject) { + @IBAction func openRepository(_ sender: Any?) { Browser.open("https://github.com/brentsimmons/Evergreen", inBackground: false) } - @IBAction func openBugTracker(_ sender: AnyObject) { + @IBAction func openBugTracker(_ sender: Any?) { Browser.open("https://github.com/brentsimmons/Evergreen/issues", inBackground: false) } @@ -437,7 +437,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations, Browser.open("https://github.com/brentsimmons/Evergreen/tree/master/Technotes", inBackground: false) } - @IBAction func showHelp(_ sender: AnyObject) { + @IBAction func showHelp(_ sender: Any?) { Browser.open("https://ranchero.com/evergreen/help/1.0/", inBackground: false) } diff --git a/Evergreen/MainWindow/AddFeed/AddFeedWindowController.swift b/Evergreen/MainWindow/AddFeed/AddFeedWindowController.swift index 44e8000ef..908e58ae5 100644 --- a/Evergreen/MainWindow/AddFeed/AddFeedWindowController.swift +++ b/Evergreen/MainWindow/AddFeed/AddFeedWindowController.swift @@ -87,12 +87,12 @@ class AddFeedWindowController : NSWindowController { // MARK: Actions - @IBAction func cancel(_ sender: AnyObject) { + @IBAction func cancel(_ sender: Any?) { cancelSheet() } - @IBAction func addFeed(_ sender: AnyObject) { + @IBAction func addFeed(_ sender: Any?) { let urlString = urlTextField.stringValue let normalizedURLString = (urlString as NSString).rs_normalizedURL() @@ -109,7 +109,7 @@ class AddFeedWindowController : NSWindowController { delegate?.addFeedWindowController(self, userEnteredURL: url, userEnteredTitle: userEnteredTitle, container: selectedContainer()!) } - @IBAction func localShowFeedList(_ sender: AnyObject) { + @IBAction func localShowFeedList(_ sender: Any?) { NSApplication.shared.sendAction(NSSelectorFromString("showFeedList:"), to: nil, from: sender) hostWindow.endSheet(window!, returnCode: NSApplication.ModalResponse.continue) diff --git a/Evergreen/MainWindow/AddFolder/AddFolderWindowController.swift b/Evergreen/MainWindow/AddFolder/AddFolderWindowController.swift index 15cbdeda8..8737dd3a7 100644 --- a/Evergreen/MainWindow/AddFolder/AddFolderWindowController.swift +++ b/Evergreen/MainWindow/AddFolder/AddFolderWindowController.swift @@ -68,12 +68,12 @@ class AddFolderWindowController : NSWindowController { // MARK: Actions - @IBAction func cancel(_ sender: AnyObject) { + @IBAction func cancel(_ sender: Any?) { hostWindow!.endSheet(window!, returnCode: NSApplication.ModalResponse.cancel) } - @IBAction func addFolder(_ sender: AnyObject) { + @IBAction func addFolder(_ sender: Any?) { hostWindow!.endSheet(window!, returnCode: NSApplication.ModalResponse.OK) } diff --git a/Evergreen/MainWindow/MainWindowController.swift b/Evergreen/MainWindow/MainWindowController.swift index 5a73960dd..026f52c7a 100644 --- a/Evergreen/MainWindow/MainWindowController.swift +++ b/Evergreen/MainWindow/MainWindowController.swift @@ -186,12 +186,12 @@ class MainWindowController : NSWindowController, NSUserInterfaceValidations { } - @IBAction func showAddFolderWindow(_ sender: Any) { + @IBAction func showAddFolderWindow(_ sender: Any?) { appDelegate.showAddFolderSheetOnWindow(window!) } - @IBAction func showAddFeedWindow(_ sender: Any) { + @IBAction func showAddFeedWindow(_ sender: Any?) { appDelegate.showAddFeedSheetOnWindow(window!, urlString: nil, name: nil) } diff --git a/Evergreen/MainWindow/Sidebar/Renaming/RenameWindowController.swift b/Evergreen/MainWindow/Sidebar/Renaming/RenameWindowController.swift index c88dca2c5..12ac8cd98 100644 --- a/Evergreen/MainWindow/Sidebar/Renaming/RenameWindowController.swift +++ b/Evergreen/MainWindow/Sidebar/Renaming/RenameWindowController.swift @@ -44,12 +44,12 @@ final class RenameWindowController: NSWindowController { // MARK: Actions - @IBAction func cancel(_ sender: AnyObject) { + @IBAction func cancel(_ sender: Any?) { window?.sheetParent?.endSheet(window!, returnCode: .cancel) } - @IBAction func rename(_ sender: AnyObject) { + @IBAction func rename(_ sender: Any?) { guard let representedObject = representedObject else { return diff --git a/Evergreen/MainWindow/Sidebar/SidebarViewController.swift b/Evergreen/MainWindow/Sidebar/SidebarViewController.swift index 3afc39974..06b47480a 100644 --- a/Evergreen/MainWindow/Sidebar/SidebarViewController.swift +++ b/Evergreen/MainWindow/Sidebar/SidebarViewController.swift @@ -165,6 +165,10 @@ import RSCore outlineView.revealAndSelectRepresentedObject(SmartFeedsController.shared.starredFeed, treeController) } + @IBAction func copy(_ sender: Any?) { + + } + // MARK: Navigation func canGoToNextUnread() -> Bool { diff --git a/Evergreen/MainWindow/Timeline/TimelineViewController.swift b/Evergreen/MainWindow/Timeline/TimelineViewController.swift index 3c188b886..a885c36ff 100644 --- a/Evergreen/MainWindow/Timeline/TimelineViewController.swift +++ b/Evergreen/MainWindow/Timeline/TimelineViewController.swift @@ -174,14 +174,14 @@ class TimelineViewController: NSViewController, UndoableCommandRunner { // MARK: - Actions - @objc func openArticleInBrowser(_ sender: AnyObject) { + @objc func openArticleInBrowser(_ sender: Any?) { if let link = oneSelectedArticle?.preferredLink { Browser.open(link) } } - @IBAction func toggleStatusOfSelectedArticles(_ sender: AnyObject) { + @IBAction func toggleStatusOfSelectedArticles(_ sender: Any?) { guard !selectedArticles.isEmpty else { return diff --git a/Evergreen/Preferences/PreferencesWindowController.swift b/Evergreen/Preferences/PreferencesWindowController.swift index ee4b83d94..dcee2fdde 100644 --- a/Evergreen/Preferences/PreferencesWindowController.swift +++ b/Evergreen/Preferences/PreferencesWindowController.swift @@ -54,7 +54,7 @@ class PreferencesWindowController : NSWindowController, NSToolbarDelegate { // MARK: Actions - @objc func toolbarItemClicked(_ sender: AnyObject) { + @objc func toolbarItemClicked(_ sender: Any?) { }