Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alessiorubicini/sfsymbolspickerforswiftui
A SwiftUI view for selecting SF symbols in your app
https://github.com/alessiorubicini/sfsymbolspickerforswiftui
icons ios sfsymbols swift-package swiftui
Last synced: 17 days ago
JSON representation
A SwiftUI view for selecting SF symbols in your app
- Host: GitHub
- URL: https://github.com/alessiorubicini/sfsymbolspickerforswiftui
- Owner: alessiorubicini
- License: mit
- Created: 2021-01-06T08:44:33.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-09-26T08:28:13.000Z (about 2 months ago)
- Last Synced: 2024-10-11T13:33:40.912Z (about 1 month ago)
- Topics: icons, ios, sfsymbols, swift-package, swiftui
- Language: Swift
- Homepage:
- Size: 2.78 MB
- Stars: 90
- Watchers: 2
- Forks: 14
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SF Symbols Picker
SFSymbolsPicker is a simple and powerful SwiftUI picker that let you pick Apple's SF Symbols inside your iOS and macOS apps with an easy binding!
![SF Symbols Picker](./Resources/SFSymbolsPicker.png)
## Changelog
### 1.0.6
- Added the ability to specify a custom close button
- Added support for macOS 11.0 and above### 1.0.5
- Optimized symbol loading performances
- Improved search bar### 1.0.4
- Fixed visibility bug for SymbolPicker view### 1.0.3
- Added the ability to automatically dismiss the view when a symbol is selected
- Added the ability to specify the view title and a label for the search bar
- Added a toolbar icon to manually dismiss the view### 1.0.2
The way the package loads SF symbols has radically changed. Now the symbols are read at run-time directly by the system, so the users can access the latest symbols added by Apple as soon as they update their devices. Special thanks to [mackoj](https://github.com/mackoj) for the suggestion in implementing this solution.
## Usage
Here's a short usage example. You can find the full code in [UsageExample.swift](https://github.com/alessiorubicini/SFSymbolsPickerForSwiftUI/blob/master/Sources/SFSymbolsPicker/UsageExample.swift).
```swift
@State private var icon = "star.fill"
@State private var isPresented = false
var body: some View {
NavigationView {
VStack {
Button("Select a symbol") {
isPresented.toggle()
}Image(systemName: icon).font(.title3)
.sheet(isPresented: $isPresented, content: {
SymbolsPicker(selection: $icon, title: "Pick a symbol", autoDismiss: true)
}).padding()}
.navigationTitle("SF Symbols Picker")
}
}
```With custom button:
```swift
....sheet(isPresented: $isPresented, content: {
SymbolsPicker(selection: $icon, title: "Pick a symbol", autoDismiss: true) {
// Your custom view...
// For example:
Text("Close!")
}
}).padding()
...
```## Installation
Required:
- iOS 15.0 or above
- macOS 12.0 or above
- Xcode 13.0 or aboveIn Xcode go to `File -> Add Package Dependencies...` and paste in the repo's url: `https://github.com/alessiorubicini/SFSymbolsPicker`.
Then choose the main branch or the version you desire.## License
Copyright 2024 (©) Alessio Rubicini.
The license for this repository is MIT License.
Please see the [LICENSE](LICENSE) file for full reference