SystemImagePicker
SystemImagePicker is a SwiftUI View
providing a cross-platform and highly customizable Picker
-like component for selecting SF Symbols.
Installation
Swift Package Manager (Xcode 11 and above)
- Select
File
/Swift Packages
/Add Package Dependency…
from the menu. - Paste
https://github.com/sbertix/SystemImagePicker.git
. - Follow the steps.
Usage
The easiest way to present the Picker
is through the provided View
extension methods.
struct SomeView: View {
@State private var isPresentingSymbols: Bool = false
@State private var symbol: String?
var body: some View {
Button("Choose a SF Symbol") {
isPresentingSymbols = true
}.systemImagePicker(
isPresented: $isPresentingSymbols,
selection: $symbol
)
}
}
But you can also initialize SystemImagePicker
directly.
Features
SystemImagePicker supports the widest variety of features of any SF Symbols picker.
- Sectioned and un-sectioned SF Symbols
- Defaults for both sectioned and un-sectioned pickers
- Filter or pass your own subset of SF Symbols to pick from
- Support both precise and human readable search (e.g.
"circle.fill"
returns only circle.fill, but"circle fill"
or"fill circle"
returns all SF Symbols having a combination of both words) - Dismiss automatically on selection or wait for user input with
.systemImagePickerDismissOnSelection(false)
- Allow for no selection using
Optional
s - Pixel-perfect padding using fully dynamic cell sizing
-
Identifiable
andRawRepresentable
support in place ofString
SF Symbol name if you wanna be extra safe or you’re using another library abstraction - Bring your own style or branding with
SystemImagePickerStyle
conformance - Support for SF Symbols 5 and visionOS
And much more!
Appearance
Light mode | Dark mode | |
---|---|---|
You can find all changelogs directly under every release. Milestones, issues, are the best way to keep updated with active developement. Feel free to contribute by sending a pull request. Just remember to refer to our guidelines and Code of Conduct beforehand. GitHub |