{"repo":"sindresorhus/Settings","free":true,"listed":false,"github":"https://github.com/sindresorhus/Settings","clone":"git clone https://github.com/sindresorhus/Settings.git","description":"⚙ Add a settings window to your macOS app in minutes","language":"Swift","stars":1550,"topics":["preferences","macos","swift-package","swift-package-manager","carthage","cocoapods","swiftui","preferences-window","swiftui-components","settings"],"license":"MIT","category":"mobile-apps","readme_excerpt":"Settings Add a settings window to your macOS app in minutes Just pass in some view controllers and this package will take care of the rest. Built-in SwiftUI support. This package is compatible with macOS 13 and automatically uses Settings instead of Preferences in the window title on macOS 13 and later. This project was previously known as Preferences . Requirements macOS 10.13 and later. Install Add https://github.com/sindresorhus/Settings in the “Swift Package Manager” tab in Xcode. Usage Run the Example Xcode project to try a live example (requires macOS 11 or later). First, create some settings pane identifiers: Second, create a couple of view controllers for the settings panes you want. The only difference from implementing a normal view controller is that you have to add the SettingsPane protocol and implement the paneIdentifier , toolbarItemTitle , and toolbarItemIcon properties, as shown below. You can leave out toolbarItemIcon if you're using the .segmentedControl style. GeneralSettingsViewController.swift Note: If you need to support macOS versions older than macOS 11, you have to add a fallback for the toolbarItemIcon . AdvancedSettingsViewController.swift If you need to respond actions indirectly, the settings window controller will forward responder chain actions to the active pane if it responds to that selector. In the AppDelegate , initialize a new SettingsWindowController and pass it the view controllers. Then add an action outlet for the Settings… menu item ","default_branch":null,"files":null,"tree":[],"storefront":"/r/sindresorhus","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/sindresorhus/Settings/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}