{"repo":"lukepistrol/SFSymbolsMacro","free":true,"listed":false,"github":"https://github.com/lukepistrol/SFSymbolsMacro","clone":"git clone https://github.com/lukepistrol/SFSymbolsMacro.git","description":"A Swift Macro for \"type-safe\" SF Symbols.","language":"Swift","stars":203,"topics":["swift","swift-macros","swift-package","swift-package-manager","swiftui","xcode15","swift5-9"],"license":"MIT","category":"mobile-apps","readme_excerpt":"= 13.0-blue.svg\" / = 11.0-blue.svg\" / = 6.0-blue.svg\" / = 13.0-blue.svg\" / SFSymbolsMacro This Swift Macro provides an easy way to make the use of SF Symbols in Swift more or less \"type-safe\" . Installation Xcode 1. Click File Add Package Dependencies 2. Paste the following link into the search field on the upper-right: Swift Package Manager In Package.swift : And then add the dependency to your targets. Usage Simply create an enum which will hold all the SF Symbols for your project: Then simply import SFSymbolsMacro and add the @SFSymbol macro annotation to the enum: The macro will then validate each case and the expanded macro will look something like this: In your code you can then call a symbol: In case the provided raw value is not a valid SF Symbol, Xcode will show a compile error at the enum-case in question: Contribution If you have any ideas on how to take this further I'm happy to discuss things in an issue. -----","default_branch":null,"files":null,"tree":[],"storefront":"/r/lukepistrol","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/lukepistrol/SFSymbolsMacro/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."}