Skip to content

Commit

Permalink
Remove .hideWindow() in favor of NSWindowController#close() (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
DivineDominion authored and sindresorhus committed Apr 5, 2019
1 parent 98e2245 commit d9ad07c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions Sources/Preferences/PreferencesWindowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -67,8 +69,4 @@ public final class PreferencesWindowController: NSWindowController {
tabViewController.activateTab(preferenceIdentifier: preferenceIdentifier, animated: false)
NSApp.activate(ignoringOtherApps: true)
}

public func hideWindow() {
close()
}
}
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit d9ad07c

Please sign in to comment.