Swiftpack.co - francisfeng/SymbolPicker as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by francisfeng.
francisfeng/SymbolPicker 0.9.0
A SF Symbols picker for Mac apps. Built with AppKit.
⭐️ 8
🕓 5 weeks ago
.package(url: "https://github.com/francisfeng/SymbolPicker.git", from: "0.9.0")

Symbol Picker

A SF Symbols picker for Mac apps. Built with AppKit.


  • macOS 11.0+


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


screenshot of Symbol Picker

  1. AppKit

// in your NSViewController subclass
import SymbolPicker

@objc func pickIcon(_ sender: Any) {
  if let windowController = SymbolPicker.windowController(
      symbol: selectedSFSymbol,
      color: symbolColor,
      delegate: self,
      title: windowTitleForTheSymbolPicker),
     let iconSheet = windowController.window {
    // You need to persist this windowController in your app.
    self.symbolPickerWindowController = windowController
    window.beginSheet(iconSheet) {
      [unowned self] _ in
      self.symbolPickerWindowController = nil

extension ViewController: SymbolPickerDelegate {
  func symbolPicker(_ symbol: String, color: NSColor?) {
  1. SwiftUI

The SymbolPicker is designed to show as a sheet window.

In SwiftUI, you can present a sheet window with the sheet modifier of Button like this:

@State var showSymbolPicker = false
@State var commandIcon = "tray"
@State var selectedColor = Color.accentColor

Button(action: {
  showSymbolPicker = true
}, label: {
  Image(systemName: commandIcon)
}).sheet(isPresented: $showSymbolPicker) {
    showSymbolPicker: $showSymbolPicker,
    selectedSymbol: $commandIcon,
    selectedColor: $selectedColor,
    title: "Command Icon",
    showColorPickerItem: false
  ).frame(minWidth: 550, maxWidth: 1920, minHeight: 320, maxHeight: 960)

// Keep `minWidth` and `minHeight` to `550` and `320` respectively
// because how the SymbolPicker is designed.


  • showSymbolPicker: if we want to show the symbol picker.
  • selectedSymbol: the name of the SF Symbol.
  • selectedColor: the color the SF Symbol.
  • title: the title of the symbol picker sheet window.
  • showColorPickerItem: if we want to show the color picker toolbar item.




Stars: 8
Last commit: 5 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics