A simple and cross-platform SFSymbol picker for SwiftUI
SymbolPicker provides a simple and cross-platform interface for picking a SFSymbol. SymbolPicker is implemented with SwiftUI and supports iOS, macOS, tvOS, watchOS and visionOS platforms.
Please use xrOS branch for visionOS. Main branch should also work fine out-of-box thanks to SwiftUI, but I'll be experimenting visionOS-only features on xrOS branch.
SymbolPicker is available as a Swift Package. Add this repo to your project through Xcode GUI or Package.swift
.
dependencies: [
.package(url: "https://github.com/xnth97/SymbolPicker.git", .upToNextMajor(from: "1.4.0"))
]
It is suggested to use SymbolPicker within a sheet
.
import SwiftUI
import SymbolPicker
struct ContentView: View {
@State private var iconPickerPresented = false
@State private var icon = "pencil"
var body: some View {
Button {
iconPickerPresented = true
} label: {
HStack {
Image(systemName: icon)
Text(icon)
}
}
.sheet(isPresented: $iconPickerPresented) {
SymbolPicker(symbol: $icon)
}
}
}
SymbolPicker is available under the MIT license. See the LICENSE file for more info.
link |
Stars: 89 |
Last commit: 4 weeks ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics