⚙ Add a preferences window to your macOS app in minutes

Overview

Preferences

Add a preferences window to your macOS app in minutes

Just pass in some view controllers and this package will take care of the rest.

Requirements

  • macOS 10.10+
  • Xcode 12.5+
  • Swift 5.4+

Install

Swift Package Manager

Add https://github.com/sindresorhus/Preferences in the “Swift Package Manager” tab in Xcode.

Carthage

github "sindresorhus/Preferences"

CocoaPods

pod 'Preferences'

Usage

Run the PreferencesExample target in Xcode to try a live example (requires macOS 11 or later).

First, create some preference pane identifiers:

import Preferences

extension Preferences.PaneIdentifier {
	static let general = Self("general")
	static let advanced = Self("advanced")
}

Second, create a couple of view controllers for the preference panes you want. The only difference from implementing a normal view controller is that you have to add the PreferencePane protocol and implement the preferencePaneIdentifier, toolbarItemTitle, and toolbarItemIcon properties, as shown below. You can leave out toolbarItemIcon if you're using the .segmentedControl style.

GeneralPreferenceViewController.swift

import Cocoa
import Preferences

final class GeneralPreferenceViewController: NSViewController, PreferencePane {
	let preferencePaneIdentifier = Preferences.PaneIdentifier.general
	let preferencePaneTitle = "General"
	let toolbarItemIcon = NSImage(systemSymbolName: "gearshape", accessibilityDescription: "General preferences")!

	override var nibName: NSNib.Name? { "GeneralPreferenceViewController" }

	override func viewDidLoad() {
		super.viewDidLoad()

		// Setup stuff here
	}
}

Note: If you need to support macOS versions older than macOS 11, you have to add a fallback for the toolbarItemIcon.

AdvancedPreferenceViewController.swift

import Cocoa
import Preferences

final class AdvancedPreferenceViewController: NSViewController, PreferencePane {
	let preferencePaneIdentifier = Preferences.PaneIdentifier.advanced
	let preferencePaneTitle = "Advanced"
	let toolbarItemIcon = NSImage(systemSymbolName: "gearshape.2", accessibilityDescription: "Advanced preferences")!

	override var nibName: NSNib.Name? { "AdvancedPreferenceViewController" }

	override func viewDidLoad() {
		super.viewDidLoad()

		// Setup stuff here
	}
}

If you need to respond actions indirectly, PreferencesWindowController will forward responder chain actions to the active pane if it responds to that selector.

final class AdvancedPreferenceViewController: NSViewController, PreferencePane {
	@IBOutlet private var fontLabel: NSTextField!
	private var selectedFont = NSFont.systemFont(ofSize: 14)

	@IBAction private func changeFont(_ sender: NSFontManager) {
		font = sender.convert(font)
	}
}

In the AppDelegate, initialize a new PreferencesWindowController and pass it the view controllers. Then add an action outlet for the Preferences… menu item to show the preferences window.

AppDelegate.swift

import Cocoa
import Preferences

@main
final class AppDelegate: NSObject, NSApplicationDelegate {
	@IBOutlet private var window: NSWindow!

	lazy var preferencesWindowController = PreferencesWindowController(
		preferencePanes: [
			GeneralPreferenceViewController(),
			AdvancedPreferenceViewController()
		]
	)

	func applicationDidFinishLaunching(_ notification: Notification) {}

	@IBAction
	func preferencesMenuItemActionHandler(_ sender: NSMenuItem) {
		preferencesWindowController.show()
	}
}

Preferences Tab Styles

When you create the PreferencesWindowController, you can choose between the NSToolbarItem-based style (default) and the NSSegmentedControl:

//
lazy var preferencesWindowController = PreferencesWindowController(
	preferencePanes: [
		GeneralPreferenceViewController(),
		AdvancedPreferenceViewController()
	],
	style: .segmentedControl
)
//

.toolbarItem style:

NSToolbarItem based (default)

.segmentedControl style:

NSSegmentedControl based

API

public enum Preferences {}

extension Preferences {
	public enum Style {
		case toolbarItems
		case segmentedControl
	}
}

public protocol PreferencePane: NSViewController {
	var preferencePaneIdentifier: Preferences.PaneIdentifier { get }
	var preferencePaneTitle: String { get }
	var toolbarItemIcon: NSImage { get } // Not required when using the .`segmentedControl` style
}

public final class PreferencesWindowController: NSWindowController {
	init(
		preferencePanes: [PreferencePane],
		style: Preferences.Style = .toolbarItems,
		animated: Bool = true,
		hidesToolbarForSingleItem: Bool = true
	)

	init(
		panes: [PreferencePaneConvertible],
		style: Preferences.Style = .toolbarItems,
		animated: Bool = true,
		hidesToolbarForSingleItem: Bool = true
	)

	func show(preferencePane: Preferences.PaneIdentifier? = nil)
}

As with any NSWindowController, call NSWindowController#close() to close the preferences window.

Recommendation

The easiest way to create the user interface within each pane is to use a NSGridView in Interface Builder. See the example project in this repo for a demo.

SwiftUI support

If your deployment target is macOS 10.15 or later, you can use the bundled SwiftUI components to create panes. Create a Preferences.Pane (instead of PreferencePane when using AppKit) using your custom view and necessary toolbar information.

Run the PreferencesExample target in the Xcode project in this repo to see a real-world example. The Accounts tab is in SwiftUI.

There are also some bundled convenience SwiftUI components, like Preferences.Container and Preferences.Section to automatically achieve similar alignment to AppKit's NSGridView. And also a .preferenceDescription() view modifier to style text as a preference description.

Tip: The Defaults package makes it very easy to persist the preferences.

struct CustomPane: View {
	var body: some View {
		Preferences.Container(contentWidth: 450.0) {
			Preferences.Section(title: "Section Title") {
				// Some view.
			}
			Preferences.Section(label: {
				// Custom label aligned on the right side.
			}) {
				// Some view.
			}
			
		}
	}
}

Then in the AppDelegate, initialize a new PreferencesWindowController and pass it the pane views.

//

lazy var preferencesWindowController = PreferencesWindowController(
	panes: [
		Pane(
			 identifier: ,
			 title: ,
			 toolbarIcon: NSImage()
		) {
			CustomPane()
		},
		Pane(
			 identifier: ,
			 title: ,
			 toolbarIcon: NSImage()
		) {
			AnotherCustomPane()
		}
	]
)

//

If you want to use SwiftUI panes alongside standard AppKit NSViewController's, instead wrap the pane views into Preferences.PaneHostingController and pass them to PreferencesWindowController as you would with standard panes.

let CustomViewPreferencePaneViewController: () -> PreferencePane = {
	let paneView = Preferences.Pane(
		identifier: ,
		title: ,
		toolbarIcon: NSImage()
	) {
		// Your custom view (and modifiers if needed).
		CustomPane()
		//  .environmentObject(someSettingsManager)
	}

	return Preferences.PaneHostingController(paneView: paneView)
}

//

lazy var preferencesWindowController = PreferencesWindowController(
	preferencePanes: [
		GeneralPreferenceViewController(),
		AdvancedPreferenceViewController(),
		CustomViewPreferencePaneViewController()
	],
	style: .segmentedControl
)

//

Full example here..

Backwards compatibility

macOS 11 and later supports SF Symbols which can be conveniently used for the toolbar icons. If you need to support older macOS versions, you have to add a fallback. Apple recommends using the same icons even for older systems. The best way to achieve this is to export the relevant SF Symbols icons to images and add them to your Asset Catalog.

Known issues

The preferences window doesn't show

This can happen when you are not using auto-layout or have not set a size for the view controller. You can fix this by either using auto-layout or setting an explicit size, for example, preferredContentSize in viewDidLoad(). We intend to fix this.

There are no animations on macOS 10.13 and earlier

The animated parameter of PreferencesWindowController.init has no effect on macOS 10.13 or earlier as those versions don't support NSViewController.TransitionOptions.crossfade.

FAQ

How can I localize the window title?

The PreferencesWindowController adheres to the macOS Human Interface Guidelines and uses this set of rules to determine the window title:

  • Multiple preference panes: Uses the currently selected preferencePaneTitle as the window title. Localize your preferencePaneTitles to get localized window titles.
  • Single preference pane: Sets the window title to APPNAME Preferences. The app name is obtained from your app's bundle. You can localize its Info.plist to customize the title. The Preferences part is taken from the "Preferences…" menu item, see #12. The order of lookup for the app name from your bundle:
    1. CFBundleDisplayName
    2. CFBundleName
    3. CFBundleExecutable
    4. Fall back to "<Unknown App Name>" to show you're missing some settings.

Why should I use this instead of just manually implementing it myself?

It can't be that hard right? Well, turns out it is:

How is it better than MASPreferences?

  • Written in Swift. (No bridging header!)
  • Swifty API using a protocol.
  • Supports segmented control style tabs.
  • SwiftUI support.
  • Fully documented.
  • Adheres to the macOS Human Interface Guidelines.
  • The window title is automatically localized by using the system string.

Related

You might also like Sindre's apps.

Used in these apps

Want to tell the world about your app that is using Preferences? Open a PR!

Maintainers

Comments
  • Add segmented control style

    Add segmented control style

    Closes https://github.com/sindresorhus/Preferences/issues/2

    I struggled a while with different approaches until I threw out NSTabViewController out of the window and began managing the toolbar in a custom controller.

    Now you can configure the style upon initialization and have it your way. Replicating the transition animation was a bit tricky because the user could click faster than the transition, ending in an invalid view state; I added a PausableWindow that swallows user events to prevent this from happening without disabling the toolbar controls.

    Enhancements I'd prefer to tackle in separate issues/PRs:

    • make the segmented control configurable: isCentered/alignment, isSizedUniformly (all segments have the same with; that's the current state)
    • make the toolbar version configurable: isCentered/alignment, toolbarStyle (icon, label, icon and label)
    • hide window management of PreferencesWindowController: make PreferencesWindowController internal, expose PreferencesController as a plain Swift object with a simple API
    • make preferences controllers configurable after initialization (which also makes it possible again to use init(fromCoder:))

    Changes to the PR:

    • [X] Extract PausableWindow into its own file and add a comment about what exactly it does and its use-case/purpose
    • [X] Use own identifiers: extension NSToolbarItem.Identifier
    • [X] consider rename crossfadeTransitions to animate
    • [X] rename preferencesWindowController.showWindow(withPreference: .advanced)
    • [X] add preferencesWindowController.change(to: .preferenceAdvanced) (obsolete)
    • [x] change style from tabs to segmented controls on the fly
    • [x] left-align toolbar items
    • [x] center window around segmented controls
    opened by DivineDominion 38
  • SwiftUI support

    SwiftUI support

    Fixes #42

    Resolved by defining PreferencePaneHostingController, wrapper around NSHostingController with PreferencePane support. User provides custom SwiftUI view and data required by the protocol. Also I've added example preference UI UserAccountsView.

    I think this is optimal way of doing this, because we can just stick with existing API. Let me know if you have any thoughts on this.


    IssueHunt Summary

    Referenced issues

    This pull request has been submitted to:


    IssueHunt has been backed by the following sponsors. Become a sponsor

    opened by fredyshox 31
  • WIP: Fix preferences window not appearing when the content views are not using auto-layout

    WIP: Fix preferences window not appearing when the content views are not using auto-layout

    This is an attempt to fix #9, specifically the part where the preference window doesn't show up.

    I tried to fix this by using viewController.view.bounds.size in cases where viewController.view.fittingSize is .zero and caching the resulting value. Without the cache, both bounds.size and fittingSize become .zero later on, which would cause problems.

    opened by SamusAranX 24
  • Add NSGridView example

    Add NSGridView example

    Description

    This PR adds an example of NSGridView used inside the preference panel. I had to increment the Deployment Target from 10.13 to 10.13.4 to be able to merge cells. Fixes #1.

    gridview

    Let me know if anything needs to be modified. Thanks.


    IssueHunt Summary

    Referenced issues

    This pull request has been submitted to:


    IssueHunt has been backed by the following sponsors. Become a sponsor

    opened by wes-nz 11
  • Add localizations for

    Add localizations for "Preferences"

    These localizations were taken from macOS system apps and should stay accurate until the definition of the word "Preferences" changes. As far as I can tell, every supported language is covered, but in case the system is using an exotic combination of region and language codes, there's a fallback to English.

    I put the ellipsized variants in their own dictionary because some of them use a localized ellipsis character. It was easier to do this than to manually construct the ellipsized strings.

    opened by SamusAranX 10
  • Preferences window title isn't localized

    Preferences window title isn't localized

    Issuehunt badges

    I just completed the German localization for an app of mine. The app's development language is English. When I start the app in Xcode with the language set to German, everything's localized correctly except for the Preferences window's title:

    Screenshot 2019-03-27 at 10 56 06

    Adding "Preferences" = "Einstellungen"; to my Localizable.strings did nothing. Is this a bug or am I missing something?

    IssueHunt Summary

    samusaranx samusaranx has been rewarded.

    Sponsors (Total: $100.00)

    Tips

    bug help wanted :gift: Rewarded on Issuehunt 
    opened by SamusAranX 10
  • Change window title to Preference Pane title

    Change window title to Preference Pane title

    Found this advice in the HIG today: https://developer.apple.com/design/human-interface-guidelines/macos/app-architecture/preferences/

    So maybe after #6 is merged,

    • [x] rename PreferencePane.toolbarTitle to simply title or preferencePaneTitle
    • [x] use the title for the window title

    This also makes #12 obsolete.

    opened by DivineDominion 9
  • Is it possible to add a flexible space between toolbar icons?

    Is it possible to add a flexible space between toolbar icons?

    I have a need to add a 'Revert' item to my preferences toolbar. I would like this item to be placed on the right of the toolbar with a flexible space between it and the other items. The flexible space pushes the item all the way to the right. I don't see an obvious way to do this in your framework. Is it possible?

    Thanks!

    opened by fracturedsoftware 6
  • Add non-uniform segment sizing switch

    Add non-uniform segment sizing switch

    This changes PreferencesStyle.segmentedControl to get an associated value:

    public enum PreferencesStyle {
    	public enum SegmentSize {
    		case fit, uniform
    	}
    	
    	case toolbarItems
    	case segmentedControl(size: SegmentSize)
    }
    

    With that, you can opt in to not use the widest segmented control size for all segments. I still think the uniform sizing looks best for 2 or 3 segments. But when you have more than 4 panes, the names and large insets become a problem and require very wide windows.

    | Uniform (old) | Fitting (new) | | ------ | ------ | | Screenshot 2020-02-20 at 18 59 28 | Screenshot 2020-02-20 at 18 59 58 |

    opened by DivineDominion 6
  • Fix window-restoration (PR #27)

    Fix window-restoration (PR #27)

    I have modified @DivineDominion's code a bit to get centering and restoring the preferences window to work.

    1. Call showWindow().
    2. Get the screen the window is located on and calculates the new coordinates.

    window.center() does not work. I don't know why.

    opened by Mortennn 6
  • Support segmented button style toolbar

    Support segmented button style toolbar

    I don't always have time to do nice icons and would like to use this style:

    image

    Note how it's segmented controls in a narrow window toolbar.

    NSTabView actually has a style for this (which is also the default), but the segmented controls ends up in the window and not in the toolbar, like this:

    screen shot 2018-06-29 at 20 26 38

    Help appreciated 🙌

    The only solution I can think of is to hide the NSTabView tabs, put an NSSegmentedControl centered in an NSToolbar, listen to when the active segment changes, and then forward that to the NSTabView. That is way more complicated than it should, so I'm hoping for someone to propose a better solution.

    enhancement help wanted 
    opened by sindresorhus 6
  • Rename

    Rename "preference" to "settings"

    Changes occurrences of "preferences" to "settings" and almost finishes #76 -- renaming the source folder and README is not done here, yet.

    opened by DivineDominion 1
  • Animate Window Size based on content change

    Animate Window Size based on content change

    Is there a possibility to animate the change in window size, when the size of the content changes? Specifically, it would be useful in SwiftUI.

    Thank you and kind regards, David

    opened by davidwernhart 2
  • Use Swift Package Manager's support for localization

    Use Swift Package Manager's support for localization

    Instead of our custom solution: https://github.com/sindresorhus/Preferences/blob/main/Sources/Preferences/Localization.swift

    See the initial attempt and feedback in https://github.com/sindresorhus/Preferences/pull/82

    enhancement help wanted 
    opened by sindresorhus 0
  • Rename project to `Settings`

    Rename project to `Settings`

    Later this year.

    • While I'm doing that, also rename preferencePaneIdentifier to paneIdentifier and preferencePaneTitle to paneTitle. And the preferencePanes parameter to panes.
    opened by sindresorhus 5
  • `loadView()` override needed if no interface builder

    `loadView()` override needed if no interface builder

    Thanks for the great project! Just wanted to mention that AFAICT if you are not using interface builder, then you need to write loadView() manually in the controllers, otherwise you get a crash:

      override func loadView() {
        self.view = NSView()
      }
    

    If this is correct, then maybe it is worth mentioning in the README.

    opened by gaborcsardi 1
Releases(v2.6.0)
  • v2.6.0(Jun 8, 2022)

    • Improve compatibility with macOS 13
      • When only using a single pane, it now uses the correct Settings term on macOS 13 and later.

    https://github.com/sindresorhus/Preferences/compare/v2.5.0...v2.6.0

    Source code(tar.gz)
    Source code(zip)
  • v2.5.0(Sep 2, 2021)

    • Add the ability to set a minimum label width on containers (#71) https://github.com/sindresorhus/Preferences/commit/5cef6c8cc0c091eb7b289e70c4d3635c84dbc7ae

    https://github.com/sindresorhus/Preferences/compare/v2.4.0...v2.5.0

    Source code(tar.gz)
    Source code(zip)
  • v2.4.0(Jul 17, 2021)

    • Add verticalAlignment option to the Section component https://github.com/sindresorhus/Preferences/commit/c980680a6191688a9d00483d5eab2665878e4c25

    https://github.com/sindresorhus/Preferences/compare/v2.3.0...v2.4.0

    Source code(tar.gz)
    Source code(zip)
  • v2.3.0(Apr 27, 2021)

  • v2.2.1(Feb 24, 2021)

    • Fix alignment for Preferences.Section component https://github.com/sindresorhus/Preferences/commit/f4f64f5849ab5f2db748f7d76945977488450a2e
    Source code(tar.gz)
    Source code(zip)
  • v2.2.0(Dec 20, 2020)

    • Forward responder chain actions to the selected pane (#67) https://github.com/sindresorhus/Preferences/commit/e2a27a2d527b9c56e35ec3aed6e1c920c8e63d1c
    Source code(tar.gz)
    Source code(zip)
  • v2.1.0(Nov 11, 2020)

  • v2.0.1(Jul 25, 2020)

  • v2.0.0(Jun 2, 2020)

    Breaking

    • Rename PreferencePane.Identifier to Preferences.PaneIdentifier https://github.com/sindresorhus/Preferences/commit/a1acf5b492a8217c69d723781455371d4e36ec55
    • Rename PreferencesStyle to Preferences.Style https://github.com/sindresorhus/Preferences/commit/99f0e0beff41029de9a1c8dd94a1af8a315f451e

    Improvements

    • SwiftUI support ⚡️ https://github.com/sindresorhus/Preferences/commit/88e47042a21ad18d5869bf8897ff1992539d4662
    Source code(tar.gz)
    Source code(zip)
  • v1.0.1(Dec 3, 2019)

    • Fix macOS version requirement in Package.swift https://github.com/sindresorhus/Preferences/commit/6c731a64dddeb33dec068d192fd57a07cd966000
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Nov 1, 2019)

    This package is now considered stable.

    • Upgrade to Swift 5.1 https://github.com/sindresorhus/Preferences/commit/b999a0a0845afbc2a5d30c825c2e4d788a4b869e
    • Lower the minimum required macOS version from 10.12 to 10.10 https://github.com/sindresorhus/Preferences/commit/669fc93c7092d70ebb8b52b82000765731fe63ab
    Source code(tar.gz)
    Source code(zip)
  • v0.4.1(Jul 6, 2019)

    • Fix window-restoration https://github.com/sindresorhus/Preferences/commit/cc25d58a9ec379812fc8f2fd7ba48f3d35b4cbff
    • Fix transition animation bug on macOS 10.13 and earlier https://github.com/sindresorhus/Preferences/commit/6b4496567e65c36b00171899c168dcd4124d7236
    Source code(tar.gz)
    Source code(zip)
  • v0.4.0(Jun 14, 2019)

    Fixes

    • Fix automatic localization of "Preferences" in the window title when there's only one preference pane. https://github.com/sindresorhus/Preferences/commit/18f009cb0b7f97ed1ce3a7d5e3b858519f3197f8
    Source code(tar.gz)
    Source code(zip)
  • v0.3.0(May 14, 2019)

    Screen Shot 2019-05-14 at 15 48 49

    The main feature of this release is a segmented control style. We have also considerably improved the API and codebase.

    Breaking

    • The Preferenceable protocol was renamed to PreferencePane
    • The required toolbarItemTitle property was renamed to preferencePaneTitle
    • You now have to provide a preferencePaneIdentifier property in your view controller
    • Remove .hideWindow() in favor of NSWindowController#close() (#21) d9ad07c
    • The PreferencesWindowController viewControllers parameter was renamed to preferencePanes
    • The .showWindow() method was renamed to .show() and you can now optionally pass in which preference pane to show

    Migrating a view controller:

    +extension PreferencePane.Identifier {
    +	static let general = Identifier("general")
    +}
    
    -final class GeneralPreferenceViewController: NSViewController, Preferenceable {
    +final class GeneralPreferenceViewController: NSViewController, PreferencePane {
    +	let preferencePaneIdentifier = PreferencePane.Identifier.general
    -	let toolbarItemTitle = "General"
    +	let preferencePaneTitle = "General"
     	let toolbarItemIcon = NSImage(named: NSImage.preferencesGeneralName)!
     	// …
    

    Enhancements

    • Add segmented control style (#6) 3b62df8 (See the readme for example)
    • Use the preference pane title as window title (#19) 891d9df To better align with the macOS Human Interface Guidelines.
    • Restore active preference when reopening window (#26) 2bb3fc7
    • Add option to hide the toolbar when there's one or less items (#25) 27f4b3e
    • Upgrade to Swift 5 e0ef252

    Known issues

    • It doesn't show the Preferences window if you're not using auto-layout for your view controllers. It's being worked on in #28. Temporary workaround.
    • It doesn't correctly localize the window title when there's only one tab. It's being worked on in #24.

    Meta

    • Welcome @DivineDominion as a maintainer 🎉
    Source code(tar.gz)
    Source code(zip)
  • v0.2.1(Jan 2, 2019)

    • Fix Gatekeeper validation errors when distributing apps (#7) https://github.com/sindresorhus/Preferences/commit/998120b432812bc4fee67c7da23ce1103b970ad6
    Source code(tar.gz)
    Source code(zip)
Owner
Sindre Sorhus
Full-Time Open-Sourcerer. Wants more empathy & kindness in open source. Focuses on Swift & JavaScript. Makes macOS apps, CLI tools, npm packages. Likes unicorns
Sindre Sorhus
Creating a blurred window background in Mac Catalyst

TransparentChrome In response to a developer question, I looked for the easiest way to provide a translucent full-window chrome with a blurred backgro

Steven Troughton-Smith 37 Dec 2, 2022
Catalyst example using an AppKit-provided NSVisualEffectView to provide a translucent blurred window

CatalystEffectViewChrome This project demonstrates how to insert an NSVisualEffe

Steven Troughton-Smith 68 Aug 11, 2022
A way to quickly add a notification badge icon to any view. Make any view of a full-fledged animated notification center.

BadgeHub A way to quickly add a notification badge icon to any view. Demo/Example For demo: $ pod try BadgeHub To run the example project, clone the r

Jogendra 772 Dec 28, 2022
An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator.

LoadingShimmer An easy way to add a shimmering effect to any view with just single line of code. It is useful as an unobtrusive loading indicator. Thi

Jogendra 1.4k Jan 4, 2023
Add the Notch on the menubar like the new MacBook Pro.

iNotch Add the Notch on the menubar like the new MacBook Pro. Installation This app works on macOS 11.0 or later. Download iNotch.zip from releases pa

Takuto NAKAMURA (Kyome) 8 Apr 3, 2022
Newly is a drop in solution to add Twitter/Facebook/Linkedin style, new updates/tweets/posts available button

Newly is a drop in solution to add Twitter/Facebook/Linkedin style, new updates/tweets/posts available button. It can be used to notify user about new content availability and can other actions can be triggers using its delegate method.

Dhiraj Rajendra Jadhao 197 Sep 22, 2022
Easily add drop shadows, borders, and round corners to a UIView.

Easily add drop shadows, borders, rounded corners to a UIView. Installation CocoaPods Add the follwing to your Podfile: pod 'Shades' Usage Storyboard

Aaron Sutton 14 Jun 20, 2020
Circular progress indicator for your macOS app

CircularProgress Circular progress indicator for your macOS app This package is used in production by apps like Gifski and HEIC Converter. Requirement

Sindre Sorhus 520 Jan 3, 2023
Show progress in your app's Dock icon

DockProgress Show progress in your app's Dock icon This package is used in production by the Gifski app. You might also like some of my other apps. Re

Sindre Sorhus 958 Jan 2, 2023
Twinkle is a Swift and easy way to make any UIView in your iOS or tvOS app twinkle.

Twinkle ✨ Twinkle is a Swift and easy way to make any UIView in your iOS or tvOS app twinkle. This library creates several CAEmitterLayers and animate

patrick piemonte 600 Nov 24, 2022
Confetti View lets you create a magnificent confetti view in your app

ConfettiView Confetti View lets you create a magnificent confetti view in your app. This was inspired by House Party app's login screen. Written in Sw

Or Ron 234 Nov 22, 2022
Super awesome Swift minion for Core Data (iOS, macOS, tvOS)

⚠️ Since this repository is going to be archived soon, I suggest migrating to NSPersistentContainer instead (available since iOS 10). For other conven

Marko Tadić 306 Sep 23, 2022
Programmatic UI for macOS

Description: Programmatic UI Framework for macOS. Swift handles app logic, CSS/SVG handles design and JSON handles struture. Installation: Step 1: Add

André J 860 Dec 18, 2022
UIPheonix is a super easy, flexible, dynamic and highly scalable UI framework + concept for building reusable component/control-driven apps for macOS, iOS and tvOS

UIPheonix is a super easy, flexible, dynamic and highly scalable UI framework + concept for building reusable component/control-driven apps for macOS, iOS and tvOS

Mohsan Khan 29 Sep 9, 2022
High performance Swift treemap layout engine for iOS and macOS.

Synopsis YMTreeMap is a high performance treemap layout engine for iOS and macOS, written in Swift. The input to YMTreeMap is a list of arbitrary numb

Yahoo 118 Jan 3, 2023
macOS GUI Library for the Nim Programming Language

NimCocoa NimCocoa is an experimental implementation of a Native GUI for the Nim programming language running on macOS. Rather than rely on low level c

null 32 Dec 8, 2022
SheetPresentation for SwiftUI. Multiple devices support: iOS, watchOS, tvOS, macOS, macCatalyst.

SheetPresentation for SwiftUI. Multiple devices support: iOS, watchOS, tvOS, macOS, macCatalyst.

Aben 13 Nov 17, 2021
Demonstration of LegoArtFilter for iOS/macOS

LegoArtFilterDemo Demonstration of LegoArtFilter for iOS/macOS. This project runs on both iOS (14≤) and macOS (11≤). Libraries LegoColors LegoArtFilte

Takuto NAKAMURA (Kyome) 1 Oct 16, 2021
Create macOS apps with Swift packages instead of Xcode projects

Swift Bundler A Swift Package Manager wrapper that allows the creation of MacOS apps with Swift packages instead of Xcode projects. My motivation is t

null 182 Dec 25, 2022