A Swift library providing type-safe access to Apple's SF Symbols with compile-time safety and version support.
SFSafeSymbols is a Swift library that provides type-safe, compile-time checked access to Apple's SF Symbols. It replaces the unsafe string-based `UIImage(systemName:)` API with a statically typed enum, preventing crashes from typos or symbol availability issues. The library automatically handles symbol availability across different OS versions and includes built-in localization support.
iOS, macOS, tvOS, and watchOS developers who use SF Symbols in their apps and want to eliminate runtime errors and improve code safety.
Developers choose SFSafeSymbols because it turns a potentially error-prone string-based API into a type-safe system, reducing bugs and improving developer productivity with automatic versioning, documentation, and localization support.
Safely access Apple's SF Symbols using static typing
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Replaces error-prone string literals like `UIImage(systemName: "circle.fill")` with compile-time checked types such as `UIImage(systemSymbol: .cCircleFill)`, preventing runtime crashes from typos.
Symbols are annotated with @availability flags based on Apple's SF Symbols versions, ensuring they're only accessible on supported OS versions, as detailed in the Supported Versions table.
Each symbol includes documentation for layersets, localizations, and appearances directly in code, eliminating the need to look up details in the SF Symbols app.
Provides both implicit automatic localization and explicit static/dynamic methods, with compile-time checks for available localizations, as shown in the Localization section.
Explicit static localization information is lost when serializing and deserializing SFSymbols, as admitted in the README, complicating state persistence in apps.
Adds an external library dependency for functionality that could be achieved with string-based APIs, which might be unnecessary for projects with minimal SF Symbol usage.
Requires learning a lower camel case naming style with prefixes for numbers (e.g., `_11CircleFill`), differing from Apple's string names and adding initial friction.