A Swift package to have SF Symbols available as enum instead of strings.
A list of all available symbols
import SwiftUI
import SFSymbolName
struct SFSymbolsView: View {
var body: some View {
VStack {
List(SFSymbolName.allCases) { symbol in
Label(LocalizedStringKey(symbol.rawValue), symbol: symbol)
}
}
}
}
- Autocompletion all SFSymbols
- Iterate through all available symbols
- Images are available depending on OS and version like this:
- Add the package to your project: Xcode->Add Package Dependency add this url: https://github.com/FullQueueDeveloper/SFSymbolName
- Import in files like this:
import SFSymbolEnum
- Add the package to the top-level
packages
key
packages:
SFSymbolEnum:
url: https://github.com/FullQueueDeveloper/SFSymbolName
from: 3.0.1
- Add the package to your target's dependencies list:
targets:
App:
type: application
platform: iOS
sources: [App]
dependencies:
- package: SFSymbolName
Swish script to generate the enum
using the name_availablity.plist
inside the SF Symbols application. Install Swish from HomeBrew, and run the generate
script
brew tap fullqueuedeveloper/swish/swish
brew install swish
swish generate