Swift package for accessing SF Symbols in a type safe manner.

Related tags

Utility Symbols
Overview


Swift Package Information

Code Coverage

Swift package for accessing SF Symbols in a type safe manner.

Features

  • 💫 Contains all SF Symbols - 1.0, 2.0, 2.1, 3.0.
  • 🏠 Supports all platforms: 📱 iOS, 💻 macOS, 📺 tvOS, ⌚️ watchOS.
  • 💯 100% Test Coverage, every SF Symbol String extension is tested.
  • 👷 Easy to maintain for future SF Symbol releases (see Maintenance section).
  • Availability checks i.e. @available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *).
  • 🧵 String extension which means you can use all the existing UIImage/NSImage initialisers.
  • 🔤 Camelcased allowing better code completion

Usage

import Symbols
// Swift >= 5.5 
UIImage(systemName: .Symbols.magazineFill) // magazine.fill
NSImage(systemSymbolName: .Symbols.magazineFill, accessibilityDescription: nil) // magazine.fill
// Swift < 5.5
UIImage(systemName: String.Symbols.magazine) // magazine.fill
NSImage(systemSymbolName: String.Symbols.magazine, accessibilityDescription: nil) // magazine.fill
// Leading numbers prefixed with underscore
UIImage(systemName: .Symbols._0CircleFill) // 0.circle.fill
NSImage(systemSymbolName: .Symbols._0CircleFill, accessibilityDescription: nil) // 0.circle.fill

Installation

SPM

Add the following to your project:

https://github.com/ptrkstr/Symbols

Maintenance

All terminal commands must be ran from the directory of this repo.

Update raw.txt

  1. Enter the following into terminal but don't press enter yet

    pbpaste > ./Generator/Sources/Generator/Resources/raw.txt
    
  2. Open SF Symbols

  3. Select all, right click, select "Copy X Names"

  4. Press enter in terminal

Update name_availability.plist

yes | cp /Applications/SF\ Symbols.app/Contents/Resources/name_availability.plist ./Generator/Sources/Generator/Resources

Generate

cd Generator; swift run; cd ..

Aren't there already packages like this?

Yep! But for one reason or another, they didn't fulfil my needs (as of 2021/11/05).

TODO

  • Show symbol in code completion
You might also like...
A declarative, thread safe, and reentrant way to define code that should only execute at most once over the lifetime of an object.

SwiftRunOnce SwiftRunOnce allows a developer to mark a block of logic as "one-time" code – code that will execute at most once over the lifetime of an

Extensions giving Swift's Codable API type inference super powers 🦸‍♂️🦹‍♀️
Extensions giving Swift's Codable API type inference super powers 🦸‍♂️🦹‍♀️

Welcome to Codextended — a suite of extensions that aims to make Swift’s Codable API easier to use by giving it type inference-powered capabilities an

Swift type modelling the success/failure of arbitrary operations.

Result This is a Swift µframework providing ResultValue, Error. ResultValue, Error values are either successful (wrapping Value) or failed (wrappi

UTIKit is an UTI (Uniform Type Identifier) wrapper for Swift.

UTIKit UTIKit is an UTI (Uniform Type Identifier) wrapper for Swift. Features UTIKit is a full featured library including entire UTI functions. Conver

DeviceGuru is a simple lib (Swift) to know the exact type of the device

DeviceGuru DeviceGuru is a simple lib (Swift) to know the exact type of the device, e.g. iPhone 6 or iPhone 6s Easy to use Light weight From version 5

A Codable Undefinable type for handling JSON undefined values.

Undefinable Overview The purpose of this type is represent the JSON undefined state in Swift structs and classes. The Undefinable enum is a generic wi

A CMIO Camera Extension of the creative camera type, with configuration app

ArtFilm A CMIO Camera Extension of the creative camera type, with configuration app ArtFilm is the sample code for the blog post Getting To Grips With

Swift Markdown is a Swift package for parsing, building, editing, and analyzing Markdown documents.

Swift Markdown is a Swift package for parsing, building, editing, and analyzing Markdown documents.

Approximate is a Swift package that provides implementations of floating point comparisons for the Swift ecosystem

Approximate Approximate floating point equality comparisons for the Swift Programming Language. Introduction Approximate is a Swift package that provi

Owner
null
Swift 3 framework for accessing data in Event Registry

Swift 3 framework for accessing data in Event Registry

Pavel Pantus 8 Nov 1, 2016
Dedicated settings app for accessing tweaks preference bundles.

Tweak Settings A dedicated settings app for tweak preferences Author Dana Buehre (CreatureSurvive) [email protected] © Dana Buehre (CreatureSurviv

Dana Buehre 29 Dec 19, 2022
Convert numeric addresses to symbols with callStackSymbols and dSYM.

Symbolicator Convert numeric addresses to symbols with callStackSymbols and dSYM files. Installation Supports Swift Package Manager.

Naruki Chigira 6 Sep 16, 2022
Get formatted call stack symbols.

CallStackSymbols Formatted call stack symbols for iOS. Installation Supports Swift Package Manager. Usage Get current call stack symbols as DLADDR arr

Naruki Chigira 9 Sep 7, 2022
Type-Safe Associated Objects in Swift

Type-Safe Associated Objects in Swift TSAO is an implementation of type-safe associated objects in Swift. Objective-C associated objects are useful, b

Lily Ballard 135 Dec 21, 2022
🚀Comprehensive Redux library for SwiftUI, ensures State consistency across Stores with type-safe pub/sub pattern.

??Comprehensive Redux library for SwiftUI, ensures State consistency across Stores with type-safe pub/sub pattern.

Cheng Zhang 18 Mar 9, 2022
Protected is a Swift Package that allows you to specify the read and write rights for any type, depending on context by using Phantom types

Protected is a Swift Package that allows you to specify the read and write rights for any type, depending on context by using Phantom types

Mathias Quintero 9 Sep 25, 2022
Swift Package Manager plugin which runs ActionBuilder to create a Github Actions workflow for a swift package.

ActionBuilderPlugin A Swift Package Manager command which builds a Github Actions workflow for the current package. By default the workflow file will

Elegant Chaos 4 Jul 20, 2022
OTAtomics - Multi-platform Swift thread-safe atomics library

OTAtomics Multi-platform Swift thread-safe atomics library. The library has full

Steffan Andrews 2 Jul 8, 2022
Safe and fast access to SwiftUI PreviewDevice

SafePreviewDevice Motivation At WWDC 2019, Apple announced SwiftUI a new library for building UI in a simple and fast way. Xcode’s SwiftUI preview let

Antonino Francesco Musolino 11 Jun 28, 2022