From d9ad07c5382064d379d2941fe3a86a6815d50b81 Mon Sep 17 00:00:00 2001 From: Christian Tietze Date: Fri, 5 Apr 2019 21:24:16 +0200 Subject: [PATCH] Remove `.hideWindow()` in favor of `NSWindowController#close()` (#21) --- Sources/Preferences/PreferencesWindowController.swift | 6 ++---- readme.md | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Sources/Preferences/PreferencesWindowController.swift b/Sources/Preferences/PreferencesWindowController.swift index 9a3548e..282b895 100644 --- a/Sources/Preferences/PreferencesWindowController.swift +++ b/Sources/Preferences/PreferencesWindowController.swift @@ -56,6 +56,8 @@ public final class PreferencesWindowController: NSWindowController { /// /// If you pass a `PreferencePaneIdentifier`, the window will activate the corresponding tab. /// + /// - See `close()` to close the window again. + /// - See `showWindow(_:)` to show the window without the convenience of activating the app. /// - Note: Unless you need to open a specific pane, prefer not to pass a parameter at all /// - Parameter preferencePane: Identifier of the preference pane to display. public func show(preferencePane preferenceIdentifier: PreferencePaneIdentifier? = nil) { @@ -67,8 +69,4 @@ public final class PreferencesWindowController: NSWindowController { tabViewController.activateTab(preferenceIdentifier: preferenceIdentifier, animated: false) NSApp.activate(ignoringOtherApps: true) } - - public func hideWindow() { - close() - } } diff --git a/readme.md b/readme.md index 895152d..88c4420 100644 --- a/readme.md +++ b/readme.md @@ -177,11 +177,11 @@ public final class PreferencesWindowController: NSWindowController { ) func show(preferencePane: PreferencePaneIdentifier? = nil) - - func hideWindow() } ``` +As usual, call `NSWindowController#close()` to close the preferences window. + ## FAQ